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/// Single-writer task and bounded write queue (ADR-067 Component A).
23pub mod writer_task;
24
25pub use backend::StorageBackend;
26pub use checkpoint::{checkpoint_once, run_checkpoint_task, CheckpointConfig, CheckpointTick};
27pub use error::SqliteError;
28pub use migrations::{
29 inspect_schema_version, query_embedding_models, read_schema_version, run_migrations,
30 EmbeddingModelRegistryRecord, Migration, ServiceSchemaPlan, VersionedMigration, MIGRATIONS,
31};
32pub use pool::{ConnectionPool, PoolConfig, ReaderGuard, WriterGuard};
33pub use sql_bridge::SqlBridge;
34pub use writer_task::WriterTaskHandle;