docs: ADR-0036 (Proposed) — bind literal DML values, verbatim text only for expressions/queries

Records the decision that advanced-mode SQL DML should stop handing literal
data values to the engine as text and instead parse/validate/bind them
through the DSL's proven path — closing the value-validation gap, the
hint/highlight gap, and the offending-value-in-errors gap together. Verbatim
text stays for expressions, WHERE, INSERT…SELECT, and SELECT (full SQL
surface preserved; ADR-0026's limited Expr not imposed). Narrows ADR-0030 §4
/ ADR-0033 §10 once accepted; SELECT half of §4 stands.

Includes a characterization test (tests/sql_insert.rs) proving the bind-layer
gap: the DSL rejects the malformed date 2025/01/15, advanced-mode SQL accepts
it. Forward-notes added to ADR-0030/0033; README index updated.

Status: Proposed (design + /runda done; pending go-ahead to implement).
This commit is contained in:
claude@clouddev1
2026-05-26 20:49:40 +00:00
parent f8a91f41c9
commit 3e3a2fb171
5 changed files with 403 additions and 1 deletions
@@ -157,6 +157,18 @@ that `docs/simple-mode-limitations.md` records as the inverse
of the simple-mode subset. The DSL `Expr` is the *DSL's*
representation; the SQL surface does not round-trip through it.
> **Forward note (2026-05-26).** The **Proposed ADR-0036** narrows the
> "DML → validated SQL text" half of this section: **literal data
> values** in `INSERT`/`UPDATE` should be parsed to typed `Value`s,
> validated, and bound as parameters (as the DSL already does), not
> handed to the engine as text — so advanced mode gets the same
> value-validation, hinting, highlighting, and error context as simple
> mode. The `SELECT` half and the full-expression-surface rationale above
> **stand**: expressions and queries remain verbatim text (ADR-0026's
> limited `Expr` is *not* imposed on the SQL surface). The dividing line
> is "bindable literal vs engine-evaluated expression-or-query." Pending
> acceptance.
### 5. Type vocabulary — the playground's, not the engine's
Advanced-mode DDL uses the playground's own ten-type