grammar+db: 3b — SQL INSERT grammar + minimal execution (ADR-0033 §1)

SQL_INSERT_SHAPE (INTO <table> [(cols)] VALUES tuple(s)) with __rdbms_*
target rejection; Command::SqlInsert{sql,target_table}; Request::RunSqlInsert
+ do_sql_insert worker (tx-guarded: execute, then finalize_persistence for
CSV + history before commit, so failures roll back and don't re-persist).
Auto-show is best-effort via last_insert_rowid range.

Isolated behind a dev `sqlinsert` entry word (Advanced) so the SQL path is
testable without making `insert` a shared word yet (that's 3j, after 3d
auto-fill parity). Command::SqlInsert carries only sql+target_table; the
plan's listed_columns/returning land in 3d/3g where they're read.

6 grammar accept/reject tests + 8 integration tests (single/multi-row,
column-list, full-arity, history, rollback-on-failure, multi-row atomicity,
parse-path reconstruction, internal-table rejection). 1452 baseline green.
This commit is contained in:
claude@clouddev1
2026-05-21 18:51:21 +00:00
parent 4e16d97fe0
commit c87363168f
10 changed files with 605 additions and 3 deletions
+3 -2
View File
@@ -84,8 +84,9 @@ use crate::dsl::walker::lex_helpers::{consume_ident, skip_whitespace};
/// Reject internal `__rdbms_*` metadata tables in any
/// table-source slot (ADR-0030 §6 reused by ADR-0032 §4 — extends
/// to every Phase-2 table-source slot: `FROM`, `JOIN` targets,
/// CTE name, and the `FROM` inside any CTE body).
fn reject_internal_table(name: &str) -> Result<(), ValidationError> {
/// CTE name, and the `FROM` inside any CTE body; ADR-0033 §1
/// reuses it on the SQL `INSERT` target slot).
pub(crate) fn reject_internal_table(name: &str) -> Result<(), ValidationError> {
if name.to_ascii_lowercase().starts_with("__rdbms_") {
Err(ValidationError {
message_key: "select.internal_table",