Expand description
SQLite storage backend for the khive knowledge graph runtime.
Provides entity, note, event, edge, FTS5 text search, and optional
sqlite-vec vector storage over a WAL-mode connection pool.
Re-exports§
pub use backend::StorageBackend;pub use checkpoint::checkpoint_once;pub use checkpoint::run_checkpoint_task;pub use checkpoint::CheckpointConfig;pub use checkpoint::CheckpointLifecycleOwner;pub use checkpoint::CheckpointTick;pub use checkpoint::run_session_sweep_task;pub use checkpoint::SessionSweepConfig;pub use checkpoint::SweepBackend;pub use error::SqliteError;pub use migrations::inspect_schema_is_current;pub use migrations::inspect_schema_version;pub use migrations::query_embedding_models;pub use migrations::read_schema_version;pub use migrations::run_migrations;pub use migrations::EmbeddingModelRegistryRecord;pub use migrations::Migration;pub use migrations::ServiceSchemaPlan;pub use migrations::VersionedMigration;pub use migrations::MIGRATIONS;pub use pool::ConnectionPool;pub use pool::PoolConfig;pub use pool::ReaderGuard;pub use pool::ReaderRow;pub use pool::WriterGuard;pub use sql_bridge::SqlBridge;pub use writer_task::WriterTaskHandle;
Modules§
- backend
- Concrete storage backend providing capability-trait factories. Concrete storage backend providing capability traits.
- checkpoint
- Periodic WAL checkpoint task. Periodic WAL checkpoint task for the connection pool (ADR-091; dedicated checkpoint connection amendment, see below).
- diagnostics
- Read-only-by-intent database-integrity and WAL/checkpoint diagnostics. Non-mutating-by-intent database, WAL, and checkpoint diagnostics (read-only operator surface).
- error
- Error types for the SQLite layer. Error types for the SQLite storage layer.
- extension
- SQLite extension registration (sqlite-vec auto-extension). SQLite extension registration for sqlite-vec.
- migrations
- Schema migration system (versioned migrations). Schema migration system for the SQLite storage layer.
- namespace_
census - What a live store’s schema says about
namespace(ADR-189). What a live store’s schema says aboutnamespace(ADR-189). - namespace_
move - Moving records between namespaces (ADR-189). Moving records between namespaces (ADR-189).
- pool
- WAL-mode connection pool: one writer, N concurrent readers. Connection pool for SQLite: one exclusive writer, N concurrent readers.
- sql_
bridge SqlAccesstrait bridge toConnectionPool. SqlAccess bridge: connectsConnectionPooltokhive_storage::SqlAccess.- stores
- Per-substrate store implementations (entity, note, graph, event, text, vectors, sparse). Per-substrate SQLite store implementations.
- walpin
- Cross-process WAL-pin attribution sidecar (ADR-091 Amendment 2 Plank B).
The sidecar write path (heartbeat/beacon) and identity primitives are
portable; directory collection (
enumerate_live/housekeep_live) is Unix-only — its only caller is the daemon’s checkpoint task, and daemon mode itself requires Unix (seekhive-mcp/src/serve.rs). ADR-091 Amendment 2 Plank B: cross-process WAL-pin attribution sidecar. - writer_
task - Single-writer task and bounded write queue (ADR-067 Component A). Single-writer task and bounded write queue (ADR-067 Component A).
Structs§
- FtsIndex
Structure - FtsLevel
Structure - FtsMaintenance
Counters - FtsSegment
Diagnostics - Request
Read Deadline - One absolute request deadline represented on async and blocking clocks.
Constants§
- DEFAULT_
REQUEST_ READ_ TIMEOUT_ SECS - Default nonzero ceiling for request-owned read work, including compose.
- DEFAULT_
SQLITE_ INTERRUPT_ GRACE_ MS - Post-deadline window for interrupted read tasks to finalize SQLite and return their connection before a coordinator escalates async cancellation.
Functions§
- await_
request_ read_ phase - Await one request-owned read phase under the current absolute deadline.
- effective_
request_ read_ deadline - Constrain
candidateby the current request’s deadline without installing a new scope. - ensure_
request_ read_ active - Refuse to begin another request-owned read phase after cancellation.
- fts_
maintenance_ counters - inherit_
request_ read_ cancellation - Intention-revealing alias for cancellation-only child tasks.
- inherit_
request_ read_ context - Capture the current request read context for a spawned child future.
- request_
read_ is_ cancelled - Return whether the current request has stopped its read-only work.
- request_
read_ timeout_ from_ env - Resolve the operator-visible request-read ceiling. Invalid/zero values fail closed to the documented nonzero default rather than disabling the guard.
- scope_
request_ read_ cancellation - Scope
futureto an explicit read-cancellation signal. - scope_
request_ read_ deadline - Scope
futureto one relative read deadline, preserving an earlier outer deadline instead of renewing it. - scope_
request_ read_ deadline_ at - Scope
futureto an already-created absolute read deadline. - sqlite_
interrupt_ grace_ from_ env - Resolve the validated SQLite interrupt-settlement grace.
- wait_
for_ request_ read_ cancellation - Wait until the current request’s read-only work is cancelled or timed out.