Expand description
The storage seam: where the ledger lives.
The ledger is two small tables in the app’s own database (Phase 3 spec,
section 5.1). An app plugs its database in by implementing LedgerStore,
or uses one of the two stores this crate ships:
rusqlite::Connection(featuresqlite): the tables<prefix>replica_collectionsand<prefix>replica_rows, written inBEGIN IMMEDIATEtransactions.MemoryLedger: a ledger that lives as long as the process. A new process starts a new epoch, so every device takes one full copy after each start. For an app with no database of its own.
The helper’s logic sees only LedgerTx; it never writes SQL.
Structs§
- Collection
Record - One collection’s ledger header (
replica_collections). - Ledger
Entry - One row of the ledger (
replica_rows): a key and what is known about it, never its value. - Memory
Ledger - A ledger held in process memory. Cloning it copies the ledger as it is now.
- Pruned
- What
LedgerTx::prune_tombstonesdid.
Traits§
- Ledger
Store - A database the ledger can live in.
- Ledger
Tx - Ledger reads and writes inside one write transaction. Keys sort by their
UTF-8 bytes (SQLite’s BINARY collation, Rust’s
strorder).