Skip to main content

SQLite Source

Read tables/views from a local SQLite database file (or an in-memory DB) as a drt sync source. Bundled in drt-core — no extra install.

Profile (~/.drt/profiles.yml)​

warehouse:
type: sqlite
database: app.db # file path, or ":memory:"

Configuration​

FieldTypeDefaultDescription
type"sqlite"—Required
databasestring:memory:Path to the .db file, or :memory: for an ephemeral in-process DB

Notes​

  • (core) — uses Python's built-in sqlite3; nothing extra to install.
  • Each sync's model SQL is executed against this database; reference any table or view it contains.
  • Handy for local development and small operational databases you want to activate out to a SaaS destination.

References​

Streaming extraction (#765)​

Rows are read in fetch_size batches rather than materialised whole, so peak memory tracks the batch instead of the result set — roughly a 25× reduction on a 300k-row extract. Measured figures for every source are collected in Extraction memory.

"It's a local file" does not make buffering free: the cost this removes is holding every row as a Python object, which a local file incurs just as readily as a remote warehouse.

fetch_size: 10000 # rows per batch (default: 10000)

Memory scales with fetch_size x row width, not row count — lower it for very wide rows, not for big tables.