Repository navigation
feat: add a SQLite adapter - #1150
Merged
Merged
Conversation
One database file per connection: SQLBuild schemas are stored as schema__name relations, main unprefixed, with a schema registry. Connections use WAL, a busy timeout and legacy_alter_table, require SQLite 3.44 and queue in-process writers per file. Tables keep declared and compile-time inferred column types; enforced decimals are stored as canonical text. Promotion, merge, delete_insert and cursor windows run in single transactions.
Cursor bounds render in SQLite's 'YYYY-MM-DD HH:MM:SS' text form, including runtime batch bounds, so text comparisons order correctly. Row counts come from COUNT(*) so full diffs can size tables. CLI E2E covers build, test, seed, query, debug, clone, diff, every incremental strategy against a DuckDB oracle, sequential microbatches without state tables, snapshots, decimal contracts, coded limits and lock waits.
…acks - Report DECIMAL(p,s) only for canonical decimal text and every other decimal as NUMERIC, so type enforcement always stores contract decimals as text; added columns use the same storage. - Record each schema relation's schema and name in _sqlbuild_relations as DDL runs; listings and relation_exists read it, and two relations sharing one table name fail with A706 at compile time. - Compare timestamp cursors as canonical UTC text on both sides in source filters, window deletes, watermarks, target envelopes and diff coverage, through an optional render_cursor_operand adapter hook that leaves other adapters unchanged. - Roll back only an open transaction, so an interrupted statement keeps its own error. - Restore the janitor's render_rename_view path; SQLite runs ALTER VIEW by recreating the view. - Count updated and inserted merge rows, URI-encode read-only paths and recreate indexes after a column type rebuild.
kvlonge
enabled auto-merge (squash)
October 19, 2026 04:23
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.
Why
Recall needs a local, file-based adapter, and SQLite is a useful lightweight warehouse in its own right (CHI-642, CHI-643; part of the Recall epic CHI-577).
Changes
sqliteadapter: one database file; schema relations stored asschema__name(main unprefixed) with a relation registry and compile-time collision refusal (A706); WAL,busy_timeout,BEGIN IMMEDIATE, in-process writer queue, read-only mode; SQLite 3.44+ (A701).inferred_columnsplan-entry field) or contracts; contractDECIMAL(p,s)stored as exact fixed-scale text.test,seed,query,debug,diff,clone, scenarios (including capture and local replay).Verification
inferred_columnsfield; compiler differential:sqlitein the unknown-adapter golden.