Skip to content

Adapters

SQLite

SQLite adapter configuration, capabilities and limits for SQLBuild.

SQLite uses Python’s built-in sqlite3 module (no extra packages required). SQLBuild requires SQLite 3.44+.

adapter = "sqlite"
default_target = "dev"
[connections.local]
path = "warehouse.sqlite"
[targets.dev]
connection = "local"
schema = "analytics"
Field Description
path Database file path relative to the project root, or :memory: (parent dirs created automatically)
busy_timeout Seconds to wait on another process’s write lock before failing with A702 (default 5)
read_only Open read-only (default false)

SQLBuild enables WAL mode and foreign keys on connect—keep SQLite files on a local filesystem, not a network share.

SQLBuild stores non-main schemas inside the single SQLite file as <schema>__<name> (main keeps bare names). Schema names cannot contain __ or end with _ (A704), targets/models cannot set database (A703), and collisions between <schema>__<name> and a main table fail compilation with A706.

Readers run concurrently with one writer. Within one sqb process, writes serialize cleanly in atomic transactions; cross-process contention waits up to busy_timeout.

  • Explicit column types: Tables use declared or compile-time inferred column types.
  • Dates and timestamps: Stored as ISO-8601 text. Avoid CAST(x AS TIMESTAMP) / CAST(x AS DATE) (SQLite truncates to the leading year integer; compile warns B104). Cursor windows compare timestamps as normalized UTC text (cursor_type timestamp accepts text columns on SQLite).
  • Booleans & JSON: Booleans store as 0/1; JSON, arrays, and objects store as JSON text.
  • Decimals: Contract- or type-enforced DECIMAL(p, s) / NUMERIC(p, s) columns store as fixed-scale canonical text (cast to REAL for numeric comparisons); unenforced decimals use SQLite numeric affinity.
Feature Support
Tables, views, seeds, unit tests, audits, snapshots, sqb diff, sqb clone Supported (clones are physical copies)
Incremental append, merge, delete_insert, cursor windows Supported (transactional)
Microbatch Sequential only (batch_concurrency > 1 refused)
Schema changes Add/drop/rename in place; type changes rebuild transactionally
Scenarios Runs on SQLite (--run-on local refused); --retain keeps temp tables
Loads and @loader Unsupported (compile error)
SQL/table functions Unsupported (A705)
Grants Ignored (SQLite has no privileges)

Recall also stores local command history in SQLite (logs/recall.sqlite3 by default, configurable via [recall] write_connection).