feat: V5a show relationship/index <name> detail views

Fold the singular per-item forms into Command::ShowList { kind,
name: Option<String> } (name: Some = one item). Two grammar
branches reuse the relationship/index completion sources; worker
do_show_one renders a labelled detail block or a friendly
"No ... named X." line, reusing the V5 render path. Help +
parse-usage entries, two ADR-0042 near-miss rows, 5 integration
tests. Mark V5a [x] — V5's [<name>] clause now complete.
This commit is contained in:
claude@clouddev1
2026-06-07 14:04:00 +00:00
parent 757711f2bf
commit 1d898adf00
13 changed files with 272 additions and 32 deletions
+19 -5
View File
@@ -332,12 +332,16 @@ pub enum Command {
ShowTable {
name: String,
},
/// Re-display a whole schema collection — every table,
/// relationship, or index — as a list in the output (V5). The
/// read-only "all items" sibling of `ShowTable`; pure display,
/// no schema change.
/// Re-display a schema collection in the output (V5/V5a). With
/// `name: None`, the whole collection — every table,
/// relationship, or index (the list-all forms). With
/// `name: Some(_)`, one named item's detail — `show
/// relationship <name>` / `show index <name>` (V5a); the table
/// singular is the separate `ShowTable`, so a named `Tables`
/// never occurs. Read-only; pure display, no schema change.
ShowList {
kind: ShowListKind,
name: Option<String>,
},
/// Insert a single row. `columns` is `None` for the natural-
/// order short form (`insert into T values (...)`); the
@@ -903,7 +907,17 @@ impl Command {
Self::AddConstraint { .. } => "add constraint",
Self::DropConstraint { .. } => "drop constraint",
Self::ShowTable { .. } => "show table",
Self::ShowList { kind } => kind.command_name(),
// A named item reports the singular verb; the list-all
// forms report the plural (`kind.command_name()`).
Self::ShowList {
kind: ShowListKind::Relationships,
name: Some(_),
} => "show relationship",
Self::ShowList {
kind: ShowListKind::Indexes,
name: Some(_),
} => "show index",
Self::ShowList { kind, .. } => kind.command_name(),
Self::Insert { .. } => "insert into",
Self::Update { .. } => "update",
Self::Delete { .. } => "delete from",