In simple mode, explain show data <T> / explain update ... / explain delete ... work and render a styled EXPLAIN QUERY PLAN tree (ADR-0028).
In advanced mode, the equivalent SQL entry points (e.g. explain select * from Customers) are not yet wired up.
Expected
Advanced mode should support explain for at least select, update, delete — same plan-tree rendering as simple mode. EXPLAIN QUERY PLAN doesn't execute the wrapped statement, so this is safe for destructive verbs as well.
Status
Known pre-existing gap; tracker.
### Observed
In simple mode, `explain show data <T>` / `explain update ...` / `explain delete ...` work and render a styled `EXPLAIN QUERY PLAN` tree (ADR-0028).
In advanced mode, the equivalent SQL entry points (e.g. `explain select * from Customers`) are not yet wired up.
### Expected
Advanced mode should support `explain` for at least `select`, `update`, `delete` — same plan-tree rendering as simple mode. `EXPLAIN QUERY PLAN` doesn't execute the wrapped statement, so this is safe for destructive verbs as well.
### Status
Known pre-existing gap; tracker.
Implemented in f62ccce (ADR-0039, marked implemented).
explain now wraps the advanced-mode SQL commands — select, with (CTE), insert, update, delete — in addition to the DSL show data/update/delete it already covered, rendering through the same ADR-0028 span-styled plan tree. Advanced mode only for the SQL inner; DSL explain unchanged in both modes.
Approach: a second Advancedexplain CommandNode (EXPLAIN_SQL) registered under the shared explain entry word, reusing the established insert/update/delete shared-word dispatch (SQL-first, DSL-fallback) — no new grammar machinery. build_explain_sql slices the inner SQL off the source (excludes the explain prefix) and reuses the existing SQL builders; do_explain_plan runs EXPLAIN QUERY PLAN over the carried text verbatim, no params. EXPLAIN QUERY PLAN never executes, so it's safe for the destructive verbs.
Verified end-to-end in the live TUI (not just unit tests): each verb renders a plan tree; explain show data still works in advanced mode (DSL fallback); the plan flips SCAN→index SEARCH once an index exists; explain of update/delete/insert does not mutate data; explain create table … (DDL) is rejected; and the hint after explain offers select/with/insert/update/delete/show.
Notes: advanced explain update/delete now route through SQL (identical plan, full SQL syntax); DSL-explain tests pinned to simple mode. A VALUES insert has no query plan in SQLite, so explain insert … values (…) shows the SQL with an empty tree (correct). The terse [ok] explain <Table> echo is pre-existing (issue #9).
23 tests added (parsing, completion, execution against real SQLite, plus a REGISTRY help-id-uniqueness invariant). Full suite 2085/0/1, clippy clean. Docs: ADR-0039 status→implemented + Implementation section, README index, requirements.md QA1, CLAUDE.md, and help/usage text.
Implemented in f62ccce (ADR-0039, marked implemented).
`explain` now wraps the advanced-mode SQL commands — `select`, `with` (CTE), `insert`, `update`, `delete` — in addition to the DSL `show data`/`update`/`delete` it already covered, rendering through the same ADR-0028 span-styled plan tree. Advanced mode only for the SQL inner; DSL `explain` unchanged in both modes.
**Approach:** a second `Advanced` `explain` CommandNode (`EXPLAIN_SQL`) registered under the shared `explain` entry word, reusing the established `insert`/`update`/`delete` shared-word dispatch (SQL-first, DSL-fallback) — no new grammar machinery. `build_explain_sql` slices the inner SQL off the source (excludes the `explain` prefix) and reuses the existing SQL builders; `do_explain_plan` runs `EXPLAIN QUERY PLAN` over the carried text verbatim, no params. `EXPLAIN QUERY PLAN` never executes, so it's safe for the destructive verbs.
**Verified end-to-end in the live TUI** (not just unit tests): each verb renders a plan tree; `explain show data` still works in advanced mode (DSL fallback); the plan flips SCAN→index SEARCH once an index exists; explain of update/delete/insert does **not** mutate data; `explain create table …` (DDL) is rejected; and the hint after `explain ` offers `select/with/insert/update/delete/show`.
**Notes:** advanced `explain update`/`delete` now route through SQL (identical plan, full SQL syntax); DSL-explain tests pinned to simple mode. A `VALUES` insert has no query plan in SQLite, so `explain insert … values (…)` shows the SQL with an empty tree (correct). The terse `[ok] explain <Table>` echo is pre-existing (issue #9).
23 tests added (parsing, completion, execution against real SQLite, plus a REGISTRY help-id-uniqueness invariant). Full suite 2085/0/1, clippy clean. Docs: ADR-0039 status→implemented + Implementation section, README index, requirements.md QA1, CLAUDE.md, and help/usage text.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Observed
In simple mode,
explain show data <T>/explain update .../explain delete ...work and render a styledEXPLAIN QUERY PLANtree (ADR-0028).In advanced mode, the equivalent SQL entry points (e.g.
explain select * from Customers) are not yet wired up.Expected
Advanced mode should support
explainfor at leastselect,update,delete— same plan-tree rendering as simple mode.EXPLAIN QUERY PLANdoesn't execute the wrapped statement, so this is safe for destructive verbs as well.Status
Known pre-existing gap; tracker.
Implemented in
f62ccce(ADR-0039, marked implemented).explainnow wraps the advanced-mode SQL commands —select,with(CTE),insert,update,delete— in addition to the DSLshow data/update/deleteit already covered, rendering through the same ADR-0028 span-styled plan tree. Advanced mode only for the SQL inner; DSLexplainunchanged in both modes.Approach: a second
AdvancedexplainCommandNode (EXPLAIN_SQL) registered under the sharedexplainentry word, reusing the establishedinsert/update/deleteshared-word dispatch (SQL-first, DSL-fallback) — no new grammar machinery.build_explain_sqlslices the inner SQL off the source (excludes theexplainprefix) and reuses the existing SQL builders;do_explain_planrunsEXPLAIN QUERY PLANover the carried text verbatim, no params.EXPLAIN QUERY PLANnever executes, so it's safe for the destructive verbs.Verified end-to-end in the live TUI (not just unit tests): each verb renders a plan tree;
explain show datastill works in advanced mode (DSL fallback); the plan flips SCAN→index SEARCH once an index exists; explain of update/delete/insert does not mutate data;explain create table …(DDL) is rejected; and the hint afterexplainoffersselect/with/insert/update/delete/show.Notes: advanced
explain update/deletenow route through SQL (identical plan, full SQL syntax); DSL-explain tests pinned to simple mode. AVALUESinsert has no query plan in SQLite, soexplain insert … values (…)shows the SQL with an empty tree (correct). The terse[ok] explain <Table>echo is pre-existing (issue #9).23 tests added (parsing, completion, execution against real SQLite, plus a REGISTRY help-id-uniqueness invariant). Full suite 2085/0/1, clippy clean. Docs: ADR-0039 status→implemented + Implementation section, README index, requirements.md QA1, CLAUDE.md, and help/usage text.