feat(help): distinct help for advanced-mode SQL forms; split list by mode (#36)
The six advanced SQL DML/query forms (SELECT, WITH, SQL_INSERT, SQL_UPDATE, SQL_DELETE, EXPLAIN_SQL) carried help_id: None, so `help select`/`help with` resolved to nothing and `help insert` showed only the simple form. Give each its own distinct help_id (data.select, data.sql_insert, …) with a hand-curated help.data.* page. Distinct strings keep the dedup invariant intact, and note_help_topic needs no change — `help insert` now shows the simple block and the sql_insert block (like `help create` already did), and the advanced-only forms resolve. note_help now groups the list by CommandCategory: app-lifecycle commands first (unlabelled), then "Simple-mode commands:" and "Advanced-mode (SQL) commands:" sections — replacing the old single "DSL data commands (in simple mode):" header, which used the banned "DSL" term and mis-labelled the advanced SQL forms it already contained. Four new help_command tests (red→green). Recorded as ADR-0024 Amendment 1; CHANGELOG updated.
This commit is contained in:
+13
-13
@@ -1886,12 +1886,12 @@ pub static EXPLAIN_SQL: CommandNode = CommandNode {
|
||||
entry: Word::keyword("explain"),
|
||||
shape: EXPLAIN_SQL_SHAPE,
|
||||
ast_builder: build_explain_sql,
|
||||
// No `help_id` / `usage_ids` — this is the `Advanced` half of the
|
||||
// shared `explain` entry word, so it defers to the `Simple`
|
||||
// `EXPLAIN` node's help/usage (which now covers the SQL forms
|
||||
// too). Mirrors the `SQL_INSERT`/`SQL_UPDATE`/`SQL_DELETE`
|
||||
// precedent; otherwise `note_help` would print `explain` twice.
|
||||
help_id: None,
|
||||
// Issue #36: its own `help` page (`data.explain_sql`), listed under the
|
||||
// advanced-mode (SQL) section and shown by `help explain` next to the
|
||||
// simple `EXPLAIN` form (distinct help_id ⇒ no dedup clash). `usage_ids`
|
||||
// stays empty — the `Simple` `EXPLAIN` node's usage block already covers
|
||||
// the shared `explain` entry word.
|
||||
help_id: Some("data.explain_sql"),
|
||||
hint_ids: &["explain_sql"],
|
||||
usage_ids: &[],
|
||||
};
|
||||
@@ -1902,13 +1902,13 @@ pub static EXPLAIN_SQL: CommandNode = CommandNode {
|
||||
/// The shape is the post-`SELECT` portion of a top-level
|
||||
/// statement; the registry's entry-word dispatch consumes the
|
||||
/// leading `SELECT` keyword before the shape walks (sub-phase
|
||||
/// 2c migration). `help_id` is `None` until the `help sql`
|
||||
/// page lands (ADR-0030 Phase 6).
|
||||
/// 2c migration). Carries its own `help` page (`data.select`),
|
||||
/// listed under the advanced-mode (SQL) section (issue #36).
|
||||
pub static SELECT: CommandNode = CommandNode {
|
||||
entry: Word::keyword("select"),
|
||||
shape: Node::Subgrammar(&sql_select::SQL_SELECT_TAIL),
|
||||
ast_builder: build_select,
|
||||
help_id: None,
|
||||
help_id: Some("data.select"),
|
||||
hint_ids: &["select"],
|
||||
usage_ids: &["parse.usage.select"],
|
||||
};
|
||||
@@ -1924,7 +1924,7 @@ pub static WITH: CommandNode = CommandNode {
|
||||
entry: Word::keyword("with"),
|
||||
shape: Node::Subgrammar(&sql_select::SQL_WITH_TAIL),
|
||||
ast_builder: build_select,
|
||||
help_id: None,
|
||||
help_id: Some("data.with"), // issue #36: own help page, advanced section
|
||||
hint_ids: &["with"],
|
||||
usage_ids: &["parse.usage.with"],
|
||||
};
|
||||
@@ -1943,7 +1943,7 @@ pub static SQL_INSERT: CommandNode = CommandNode {
|
||||
entry: Word::keyword("insert"),
|
||||
shape: Node::Subgrammar(&sql_insert::SQL_INSERT_SHAPE),
|
||||
ast_builder: build_sql_insert,
|
||||
help_id: None,
|
||||
help_id: Some("data.sql_insert"), // issue #36: own help page, advanced section
|
||||
hint_ids: &["sql_insert"],
|
||||
usage_ids: &[],
|
||||
};
|
||||
@@ -1957,7 +1957,7 @@ pub static SQL_UPDATE: CommandNode = CommandNode {
|
||||
entry: Word::keyword("update"),
|
||||
shape: Node::Subgrammar(&sql_update::SQL_UPDATE_SHAPE),
|
||||
ast_builder: build_sql_update,
|
||||
help_id: None,
|
||||
help_id: Some("data.sql_update"), // issue #36: own help page, advanced section
|
||||
hint_ids: &["sql_update"],
|
||||
usage_ids: &[],
|
||||
};
|
||||
@@ -1973,7 +1973,7 @@ pub static SQL_DELETE: CommandNode = CommandNode {
|
||||
entry: Word::keyword("delete"),
|
||||
shape: Node::Subgrammar(&sql_delete::SQL_DELETE_SHAPE),
|
||||
ast_builder: build_sql_delete,
|
||||
help_id: None,
|
||||
help_id: Some("data.sql_delete"), // issue #36: own help page, advanced section
|
||||
hint_ids: &["sql_delete"],
|
||||
usage_ids: &[],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user