Release 2.5.0 — SQL dialect expansion: multi-table joins, subqueries, additive ALTER TABLE#23
Merged
Merged
Conversation
…itive ALTER TABLE - INNER/LEFT JOIN across any number of tables, including self-joins (left-deep hash joins; distinct alias per occurrence enforced) - Uncorrelated subqueries: IN (SELECT ...), NOT IN, scalar comparisons — inner-query-first rewrite into literals, so IN lists zone-map-prune and commit retries re-evaluate against the fresh snapshot; correlated refs get a pointed error - ALTER TABLE ... ADD COLUMN (plain nullable only): schema-only commit, absent keys read as NULL at every read path; DROP/RENAME rejected by name with the time-travel reason - Additive schema drift auto-migrates at connect: add a plain column to defineSchema, redeploy, done - sql-smoke: 101 -> 132 checks (271 total); design doc §7/§8/§14 and all agent-facing docs updated Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ation guards From self-review + independent gpt-5.5 pass: - appendSchema excludes subquery VALUES and columns unknown to the code schema (both must plan on the ordered path) - planInsert NULL-fills ALTERed columns so DO UPDATE SET can read them - connect() re-verifies drift after the auto-migration commit (a racing process may have added the same column with a different definition) - IN (SELECT ...) drops NULLs from the resolved list — two-valued semantics made explicit and documented in design doc §7, along with rebase-keeps-snapshot-values (ordinary snapshot isolation) - +2 regression checks (275 total) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three of the four SQL-dialect roadmap items (LARVA-DESIGN.md §14), re-judged against the §7 admission bar in July 2026 and shipped together. Secondary index blobs are the remaining item and come next as 2.6.0.
3+ table joins & self-joins
INNER/LEFT JOINacross any number of tables: left-deep hash joins in statement order; eachONcompares a column of the joined table with a column of any table already in scope.FROM staff e JOIN staff m ON e.managerId = m.id), so columns can always be attributed. Missing aliases get aDUPLICATE_TABLE_NAMEerror that shows the fix.RIGHT/FULL/CROSSstay excluded by name.Uncorrelated subqueries
WHERE id IN (SELECT …),NOT IN, and scalar comparisons (total > (SELECT AVG(total) FROM orders)) — implemented exactly as §14 planned: inner-query-first. The subquery executes against the same snapshot as the outer statement and its AST node is rewritten into plain literals before planning, which buys two properties for free:IN (SELECT …)lists participate in zone-map pruning like literal lists.Nesting works; shape errors are precise (
SUBQUERY_MULTIPLE_ROWS,SUBQUERY_SHAPE); correlated references keep their original name error plus a pointer atJOIN;EXISTSgets a redirect hint. Derived tables (subqueries inFROM) remain excluded. A subquery inVALUESreads database state, so it is excluded from the tier-A fast-append classification and takes the ordered path.Additive ALTER TABLE
ALTER TABLE t ADD COLUMN name type— a schema-only commit: existing chunks are untouched and absent keys read asNULLat every read path (queries, upsert planning, export). Cost is one log/manifest write regardless of table size.DROP COLUMN,RENAME,ADD CONSTRAINT,NOT NULL,DEFAULT,UNIQUE/PRIMARY KEYon added columns: each rejected by name with the reason (most: waiting on a migration design that respects time travel).defineSchemaand redeploying just works — it is exactlyADD COLUMN, so connect applies it instead of failing. Everything else still fails loudly withSCHEMA_DRIFT.UNKNOWN_COLUMN) on queries that touch the added column in old chunks — never silently wrong.Tests — 275 checks (was 240)
Docs synced: design doc §7/§8/§14, content/sql.mdx (new subquery + ALTER sections), docs/larva-for-agents.md (→ /llms.txt), quickstart/agent prompt, READMEs, CLAUDE.md.
Self-review plus an independent gpt-5.5 (codex) correctness review; four findings triaged pre-PR:
DO UPDATE SETNULL-fills ALTERed columns; drift auto-migration re-verifies after its commit (concurrent conflicting addition race).NOT IN (SELECT …)drops NULLs (Larva is two-valued throughout — no SQL NULL-poisoning trap); a rebase after a disjoint conflict keeps subquery values read from the planning snapshot (ordinary snapshot isolation, same as transactions).🤖 Generated with Claude Code