8bd43ccadf
`create m:n relationship from <T1> to <T2> [as <name>]` generates a
junction table with one FK column per parent PK column ({table}_{pkcol},
typed via fk_target_type), a compound PK over them, and two CASCADE 1:n
relationships -- all in one do_create_table call = one undo step.
Auto-named {T1}_{T2} (optional `as`), both modes, compound-parent PKs
supported (ADR-0043). Self-referential m:n / PK-less parent / internal
junction name / name collision all refused.
Wired across every surface: grammar (separate CREATE_M2N node), worker
executor, runtime dispatch, completion ("m:n" composite), hints,
highlighting, help + usage catalog + disambiguator, and the advanced-mode
DSL->SQL teaching echo (render_create_m2n, round-trips as valid SQL).
Generalized/fixed framework assumptions the build + two /runda passes
surfaced (all behaviour-preserving for existing commands):
- simple-mode dispatch committed simple.first() unconditionally -> tries
candidates, so `create table` no longer shadows `create m:n`.
- the completion continuation-merge was advanced-only -> runs in simple
mode too when an entry word has >1 DSL form (gated simple_count>1).
- do_create_table now rejects internal `__rdbms_*` names (closes a
pre-existing hole on the DSL create-table path too, not just m:n).
- usage disambiguator now recognizes the `m:n` opener.
Tests: 14 integration (tests/it/m2n.rs), 7 typing-surface matrix, echo /
highlight / usage / internal-name units. Closes C4.
2237 pass / 0 fail / 1 ignored. Clippy clean.
39 lines
1.0 KiB
Rust
39 lines
1.0 KiB
Rust
//! Consolidated integration-test binary (see
|
|
//! `docs/plans/20260602-test-consolidation.md`).
|
|
//!
|
|
//! Each former top-level `tests/*.rs` is now a module here, so the
|
|
//! whole suite links into **one** binary instead of 26 — turning an
|
|
//! edit-the-lib-then-test cycle from 26 separate links into one.
|
|
//! `tests/typing_surface_matrix.rs` stays a separate binary (it is
|
|
//! already a consolidated `mod`-based target).
|
|
|
|
mod case_insensitive_names;
|
|
mod column_op_guards;
|
|
mod compound_fk;
|
|
mod engine_vocabulary_audit;
|
|
mod friendly_enrichment;
|
|
mod help_command;
|
|
mod iteration2_persistence;
|
|
mod iteration3_rebuild;
|
|
mod iteration4a_rebuild_command;
|
|
mod iteration4b_lifecycle_commands;
|
|
mod iteration5_export_import;
|
|
mod iteration6_resume_history;
|
|
mod m2n;
|
|
mod parse_error_pedagogy;
|
|
mod project_lifecycle;
|
|
mod replay_command;
|
|
mod sql_alter_table;
|
|
mod sql_create_index;
|
|
mod sql_create_table;
|
|
mod sql_delete;
|
|
mod sql_dml_e2e;
|
|
mod sql_drop_index;
|
|
mod sql_drop_table;
|
|
mod sql_insert;
|
|
mod sql_select;
|
|
mod sql_update;
|
|
mod show_list;
|
|
mod undo_snapshots;
|
|
mod walking_skeleton;
|