Expand description
The reference SQLite store (ADR 0017 §2): Kovlet’s bookkeeping tables in a SQLite file, either its own or the app’s.
SqliteStore::open: its own file, with the built-in row store, so an app with no database can read rows back (space.table("todos").all()).SqliteStore::shared: the app’s own connection. The bookkeeping tables live next to the app’s tables, and the core runs the app’sapplyand its owncommitin one transaction.SqliteStore::shared_batchis the same with oneapplycall perChangeBatchinstead of perChange.SqliteStore::lending: for an app whose database type owns its connection (and keeps derived state on write). The app lends its connection for one transaction at a time, e.g.|f| db.with_tx(f), so app rows, derived state and Kovlet’s bookkeeping commit together.- Record mode: inside its own transaction, the app writes its rows and
calls
space.record(&tx, table, id, fields), which queues the write in the same transaction (Workplane’s pattern).
Structs§
- Sqlite
Store - See the module docs.
Constants§
- SCHEMA
- The bookkeeping schema (ADR 0017 §2), plus
trashedon the_deletedrow.
Type Aliases§
- Apply
Batch Fn - Writes a whole batch into the app’s own tables, inside the core’s transaction.
- ApplyFn
- Writes one change into the app’s own tables, inside the core’s transaction.
- LendFn
- Lends the app’s connection for one transaction: begin a transaction, call
fwith it, commit iffreturnsOk, roll back otherwise, and returnf’s result. SeeSqliteStore::lending.