Module db

Module db 

Source
Expand description

Host database integration for sync bookkeeping.

coven owns three bookkeeping tables — sync_cursors, sync_state, cloud_outbox — created by applying MIGRATION_SQL to the host’s database. The host implements SyncBookkeeping (coven calls these during a sync cycle) and RawDbHandle (the session extension attaches to the host’s write connection). coven imposes no SQLite driver this way.

Structs§

DbError
An error from the host’s bookkeeping implementation.
OutboxEntry
A pending cloud blob operation from the cloud_outbox table.

Enums§

OutboxOperation
Type of cloud blob operation.

Constants§

MIGRATION_SQL
SQL that creates coven’s bookkeeping tables. The host applies this alongside its own schema migration. Idempotent (IF NOT EXISTS).

Traits§

RawDbHandle
Access to the host’s raw write connection, which the session extension attaches to. The same connection the host writes through.
SyncBookkeeping
Bookkeeping the host’s database performs against coven’s tables. coven calls these during a sync cycle; the host’s implementation runs the SQL.
SyncDb
The full database surface coven needs from the host: bookkeeping plus the raw write handle. Blanket-implemented for any type providing both.