feat: support explain over advanced-mode SQL queries

explain now wraps the advanced SQL commands — select, with (CTE),
insert, update, delete — in addition to the DSL show data/update/
delete it already covered, rendering through the same plan tree
(ADR-0039, closing the ADR-0030 OOS-2 gap).

Implemented as a second Advanced `explain` CommandNode under the
shared entry word, reusing the established shared-word dispatch
(SQL-first, DSL-fallback) rather than new grammar machinery.
build_explain_sql slices the inner SQL off the source and reuses the
existing SQL builders; do_explain_plan runs EXPLAIN QUERY PLAN over
the carried text verbatim (never executes, so safe for destructive
verbs). Advanced explain update/delete now route through SQL with an
identical plan; DSL-explain tests pinned to simple mode. Help and
usage text now list the advanced explain forms.
This commit is contained in:
claude@clouddev1
2026-05-30 18:44:05 +00:00
parent f7ca288fe1
commit f62cccec55
8 changed files with 503 additions and 14 deletions
+5 -1
View File
@@ -509,7 +509,11 @@ handoff-14 cleanup; 449 after B2/C2.)
*(Implemented per ADR-0028: the `explain` prefix over
`show data` / `update` / `delete`, with a span-styled plan
tree. `EXPLAIN QUERY PLAN` never executes, so explaining a
destructive `update` / `delete` is safe.)*
destructive `update` / `delete` is safe. Extended 2026-05-30,
issue #7 / ADR-0039: `explain` now also wraps advanced-mode
SQL — `select` / `with` / `insert` / `update` / `delete` — via
a second `Advanced` `explain` CommandNode on the shared entry
word, reusing the same plan-tree renderer.)*
- [x] **QA2** Plan rendering specifics — tree layout, annotation
taxonomy, colour scheme. Implemented per ADR-0028 (§3–§6):
a box-drawing tree, the substring-pattern taxonomy, and the