Skip to main content

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
23pub use backend::StorageBackend;
24pub use checkpoint::{checkpoint_once, run_checkpoint_task, CheckpointConfig, CheckpointTick};
25pub use error::SqliteError;
26pub use migrations::{
27    inspect_schema_version, query_embedding_models, read_schema_version, run_migrations,
28    EmbeddingModelRegistryRecord, Migration, ServiceSchemaPlan, VersionedMigration, MIGRATIONS,
29};
30pub use pool::{ConnectionPool, PoolConfig, ReaderGuard, WriterGuard};
31pub use sql_bridge::SqlBridge;