Skip to main content

Module db

Module db 

Source
Expand description

SQLite projection database utilities.

Runtime defaults are intentionally conservative:

  • journal_mode = WAL to allow concurrent readers while writers append
  • busy_timeout = 5s to reduce transient lock failures under contention
  • foreign_keys = ON to protect relational integrity in projection tables

Modules§

fts
FTS5 full-text search with BM25 ranking.
incremental
Incremental projection rebuild and invalidation.
migrations
SQLite schema migrations for the disposable projection database.
project
Event replay → SQLite projection pipeline.
query
SQLite query helpers for the projection database.
rebuild
Full projection rebuild from the event log.
schema
Canonical SQLite projection schema for bones.

Constants§

DEFAULT_BUSY_TIMEOUT
Busy timeout used for projection DB connections.

Functions§

ensure_projection
Ensure the projection database exists and is up-to-date.
mark_projection_dirty
Mark projection state as dirty so read paths trigger deterministic recovery.
mark_projection_dirty_from_connection
Mark projection dirty by resolving the active database path from a connection.
open_projection
Open (or create) the projection SQLite database, apply runtime pragmas, and migrate schema to the latest version.
projection_dirty_marker_path
Compute the marker path that signals projection drift.