sqlite
etl_craft.dialects.engine.sqlite ¶
SQLite: the default Engine DB, one file and nothing to install.
It suits local development and single-machine deployments. PostgreSQL remains the production recommendation: a SQLite file cannot be reached by workers on other hosts, and every write is serialized.
MIN_SQLITE_VERSION
module-attribute
¶
RETURNING needs SQLite 3.35; an older library is refused when connecting.
BUSY_TIMEOUT_MS
module-attribute
¶
How long a writer waits for another process's write; Engine DB writes are short.
SqliteEngineDialect ¶
Bases: EngineDialect
SQLite: one file, file locks, and every transaction opened with BEGIN IMMEDIATE.
refresh_metadata_triggers ¶
Install this database's metadata capture and write guards.
build_engine ¶
Build the engine for a jdbc:sqlite: profile; there is nothing to authenticate.
split_statements ¶
Split a script into statements, keeping trigger bodies whole.
A ; ends a statement only when SQLite's own complete_statement agrees, so the
semicolons inside CREATE TRIGGER ... BEGIN ...; ...; END; do not.
migration_transaction ¶
migration_transaction(engine: Engine, *, rebuild_metadata: str | None = None) -> Iterator[Connection]
Rebuild metadata tables with references checked before commit and pragmas restored.
lock ¶
Hold an OS file lock beside the database file.
Every process that could contend runs on the machine holding the file, and the OS
releases the lock if its holder dies. The lock file's name plays the part of key.
resolve_sqlite_path ¶
Return the database file a jdbc:sqlite: URL names.
A relative path resolves against the directory holding craft-connector.yml, not the
working directory, so every command and task process opens the same file wherever it
starts. An in-memory database is refused: each task runs in its own process and would see
an empty one.
sqlite_creator ¶
Return a function that opens one configured connection to database.
Each connection uses WAL, so readers proceed while one process writes; waits up to
BUSY_TIMEOUT_MS for another writer; and enforces foreign keys, which SQLite leaves off
by default. TIMESTAMP columns read back as timezone-aware datetimes. The driver opens no
transactions of its own (isolation_level=None); SQLAlchemy's begin event does.