c1e52920eb
Track 1 implementation plus polish round. Parser (chumsky): - Grammar-based DSL producing a typed Command AST. - create table X with pk [name:type[,name:type...]] supports arbitrary names, any user type, compound PKs natively. Bare form errors with a friendly hint pointing at `with pk`. - add column to table X: Name (type); drop table X. - Required clauses use keyword grammar; -- reserved for opt-in flags (ADR-0009). Custom Rich reasons preferred when surfacing chumsky errors so unknown-type messages list valid alternatives. Database (ADR-0010, ADR-0012): - rusqlite + STRICT tables + foreign_keys=ON. - Dedicated worker thread; mpsc Request inbox, oneshot replies. - Typed DbError with friendly_message() hook for H1. - Internal __rdbms_playground_columns metadata table preserves user-facing types across schema reads, atomically maintained alongside DDL via Connection transactions. list_tables hides it via the new __rdbms_ internal-table convention. Types (ADR-0005, ADR-0011): - All ten user-facing types: text, int, real, decimal, bool, date, datetime, blob, serial, shortid. - Type::fk_target_type() for FK-side column-type rule (Serial->Int, ShortId->Text, others identity) -- foundation for the FK iteration. App / Runtime / UI: - update() stays pure-sync; runtime dispatches DSL via spawned tasks, results post back as AppEvent::Dsl*. - Items panel renders live tables list; output panel shows the user-facing structure of the current table after each DDL. - In-memory command history (Up/Down, draft preservation, consecutive-duplicate dedup) -- I2 partial. - Mouse capture removed; terminal native text selection restored (toggle approach revisited when scroll/click features land). Docs: - ADRs 0009 (DSL syntax conventions), 0010 (DB worker), 0011 (FK type compat), 0012 (internal metadata table). - requirements.md progress notes; new V4 entry for the scrollable session-log + inline rich rendering + Markdown export direction. Tests: 103 passing (91 lib + 12 integration), 0 skipped. Clippy clean with nursery enabled.
38 lines
1.1 KiB
TOML
38 lines
1.1 KiB
TOML
[package]
|
|
name = "rdbms-playground"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
description = "A cross-platform TUI playground for learning relational databases."
|
|
license = "MIT OR Apache-2.0"
|
|
repository = "https://github.com/sturm/rdbms-playground"
|
|
readme = "README.md"
|
|
publish = false
|
|
|
|
[dependencies]
|
|
anyhow = "1.0.102"
|
|
chumsky = "0.13.0"
|
|
crossterm = { version = "0.29.0", features = ["event-stream"] }
|
|
futures-util = "0.3.32"
|
|
ratatui = "0.30.0"
|
|
rusqlite = { version = "0.39.0", features = ["bundled"] }
|
|
thiserror = "2.0.18"
|
|
tokio = { version = "1.52.2", features = ["full"] }
|
|
tracing = "0.1.44"
|
|
tracing-subscriber = { version = "0.3.23", features = ["env-filter"] }
|
|
|
|
[dev-dependencies]
|
|
insta = { version = "1.47.2", features = ["yaml"] }
|
|
pretty_assertions = "1.4.1"
|
|
|
|
[lints.rust]
|
|
unsafe_code = "forbid"
|
|
unreachable_pub = "warn"
|
|
|
|
[lints.clippy]
|
|
all = { level = "warn", priority = -1 }
|
|
nursery = { level = "warn", priority = -1 }
|
|
# Allow common false-positives that don't materially improve our code.
|
|
module_name_repetitions = "allow"
|
|
missing_errors_doc = "allow"
|
|
missing_panics_doc = "allow"
|