feat: V5 show tables / relationships / indexes list commands

Add the list-all show family as one Command::ShowList { kind }
variant. A read-only worker show_list formats count-headed lists
(reusing do_list_tables / read_all_relationships /
read_table_indexes, so it never drifts from the items panel);
internal __rdbms_* tables excluded. Help + parse-usage entries
added; 10 integration tests in tests/it/show_list.rs.

Mark V5 [x]. Split the singular show relationship/index <name>
detail forms (the [<name>] half) into a new tracked V5a [ ] item
rather than leaving them as an untracked footnote.
This commit is contained in:
claude@clouddev1
2026-06-07 13:20:52 +00:00
parent 28e75961aa
commit 8dec784080
15 changed files with 555 additions and 27 deletions
+30 -11
View File
@@ -605,6 +605,15 @@ impl App {
self.handle_dsl_explain_success(&command, &plan);
Vec::new()
}
AppEvent::DslShowListSucceeded { command, lines } => {
// Mark the echo ✓ (ADR-0040), then emit the
// worker-formatted list as system output lines.
self.note_ok_summary(&command);
for line in lines {
self.note_system(line);
}
Vec::new()
}
AppEvent::DslInsertSucceeded { command, result } => {
self.handle_dsl_insert_success(&command, &result);
Vec::new()
@@ -2007,6 +2016,9 @@ impl App {
C::ShowData { name, .. } | C::ShowTable { name } => {
(Operation::Query, Some(name.as_str()), None)
}
// A `show <kind>` list spans no single table; a failure
// routes through Query with no table fallback.
C::ShowList { .. } => (Operation::Query, None, None),
// A SQL `SELECT` carries only its statement text —
// no single table name to fall back on. A query
// failure routes through `Operation::Query`.
@@ -2822,13 +2834,21 @@ mod tests {
#[test]
fn tab_cycles_forward_through_multi_candidate_set() {
// `show ` offers five subcommands in grammar order:
// data / table / tables / relationships / indexes (V5).
let mut app = App::new();
type_str(&mut app, "show ");
app.update(key(KeyCode::Tab));
assert_eq!(app.input, "show data");
app.update(key(KeyCode::Tab));
assert_eq!(app.input, "show table");
// Wrap-around.
for expected in [
"show data",
"show table",
"show tables",
"show relationships",
"show indexes",
] {
app.update(key(KeyCode::Tab));
assert_eq!(app.input, expected);
}
// Wrap-around back to the first.
app.update(key(KeyCode::Tab));
assert_eq!(app.input, "show data");
}
@@ -2837,12 +2857,11 @@ mod tests {
fn shift_tab_cycles_backward_starting_from_last() {
let mut app = App::new();
type_str(&mut app, "show ");
app.update(key(KeyCode::BackTab));
assert_eq!(app.input, "show table");
app.update(key(KeyCode::BackTab));
assert_eq!(app.input, "show data");
app.update(key(KeyCode::BackTab));
assert_eq!(app.input, "show table");
// Backward starts from the last candidate (`indexes`).
for expected in ["show indexes", "show relationships", "show tables"] {
app.update(key(KeyCode::BackTab));
assert_eq!(app.input, expected);
}
}
#[test]