Skip to content

featherweight.sqlite

sqlite

SqliteDatabase: the run log in a sqlite file. For local development; deployments use PostgresDatabase.

SqliteDatabase

SqliteDatabase(path: str | Path)

Bases: Database

path is the sqlite file, or ":memory:" for a database that lives in memory (no file, gone when it closes).

transaction async

transaction() -> AsyncGenerator[Connection]

One write transaction at a time on the connection, committed at the end and rolled back on any error. Everything that writes (the run log, the result store, the queue) goes through it, so that two tasks writing at once cannot commit or roll back each other's half-done work.

statements

statements(script: str) -> list[str]

The statements of a migration, one by one, so that they can run in a transaction that was begun by hand.