docs: ADR-0035 4a plan + 4a.2 split for composite UNIQUE / table CHECK
Add the sub-phase 4a implementation plan (docs/plans/), test-first, mirroring the ADR-0033 DML sub-phase model: SqlCreateTable as its own command executed structurally through the existing do_create_table helper; shared-entry-word dispatch (SQL-first, simple fallback); the type-alias resolver; IF NOT EXISTS no-op-with-note (CreateOutcome enum); INTEGER PRIMARY KEY -> plain int; one-undo-step wiring. Records the user-confirmed 4a/4a.2 split: composite UNIQUE(a,b) and multi-column table CHECK move to a dedicated slice because they are the first structures TableSchema cannot already represent, so they need a persistence-model + round-trip extension rather than parse+execute reuse. ADR-0035 §13 gains 4a.2; README sub-phase line updated in lockstep.
This commit is contained in:
@@ -307,7 +307,18 @@ ADR-0033's structure:
|
||||
- **4a — Dispatch + `CREATE TABLE` core.** Advanced `create`
|
||||
dispatch; `SqlCreateTable` for columns + types (the §3 map) +
|
||||
column constraints + single/compound `PRIMARY KEY`, plus
|
||||
`IF NOT EXISTS` (no-op-with-note, §4). No FK yet.
|
||||
`IF NOT EXISTS` (no-op-with-note, §4). Single-column table-level
|
||||
`UNIQUE`/`CHECK` normalise into the column; **no FK** (4b). Reuses
|
||||
`do_create_table`.
|
||||
- **4a.2 — Composite `UNIQUE(a,b)` / multi-column table `CHECK`.**
|
||||
Split out (2026-05-24, user-confirmed) because these are the first
|
||||
structures the data model cannot already represent: `TableSchema`
|
||||
has no slot for them. A self-contained slice that extends
|
||||
`TableSchema` + the YAML round-trip + `read_schema` detection +
|
||||
`do_create_table` DDL emission, with save/load/rebuild tests. (The
|
||||
general rule: a DDL feature needs data-model work only when it
|
||||
introduces a structure simple mode could never produce — cf. the
|
||||
`UNIQUE`-index flag in 4d and the new rename op in 4h.)
|
||||
- **4b — Foreign keys in `CREATE TABLE`.** Inline `REFERENCES` +
|
||||
table-level `FOREIGN KEY` → relationship metadata, one undo step.
|
||||
- **4c — `DROP TABLE [IF EXISTS]`** → `SqlDropTable` (cascade parity;
|
||||
|
||||
Reference in New Issue
Block a user