khive_db/lib.rs
1//! SQLite storage backend for the khive knowledge graph runtime.
2//!
3//! Provides entity, note, event, edge, FTS5 text search, and optional
4//! `sqlite-vec` vector storage over a WAL-mode connection pool.
5
6/// Concrete storage backend providing capability-trait factories.
7pub mod backend;
8/// Periodic WAL checkpoint task.
9pub mod checkpoint;
10/// Error types for the SQLite layer.
11pub mod error;
12/// SQLite extension registration (sqlite-vec auto-extension).
13pub mod extension;
14/// Schema migration system (versioned migrations).
15pub mod migrations;
16/// WAL-mode connection pool: one writer, N concurrent readers.
17pub mod pool;
18/// `SqlAccess` trait bridge to `ConnectionPool`.
19pub mod sql_bridge;
20/// Per-substrate store implementations (entity, note, graph, event, text, vectors, sparse).
21pub mod stores;
22/// Cross-process WAL-pin attribution sidecar (ADR-091 Amendment 2 Plank B).
23/// The sidecar write path (heartbeat/beacon) and identity primitives are
24/// portable; directory enumeration (`enumerate_live`) is Unix-only — its
25/// only caller is the daemon's checkpoint task, and daemon mode itself
26/// requires Unix (see `khive-mcp/src/serve.rs`).
27pub mod walpin;
28/// Single-writer task and bounded write queue (ADR-067 Component A).
29pub mod writer_task;
30
31pub use backend::StorageBackend;
32pub use checkpoint::{checkpoint_once, run_checkpoint_task, CheckpointConfig, CheckpointTick};
33pub use checkpoint::{run_session_sweep_task, SessionSweepConfig, SweepBackend};
34pub use error::SqliteError;
35pub use migrations::{
36 inspect_schema_version, query_embedding_models, read_schema_version, run_migrations,
37 EmbeddingModelRegistryRecord, Migration, ServiceSchemaPlan, VersionedMigration, MIGRATIONS,
38};
39pub use pool::{ConnectionPool, PoolConfig, ReaderGuard, WriterGuard};
40pub use sql_bridge::SqlBridge;
41pub use writer_task::WriterTaskHandle;