Expand description
mempill-sqlite — SQLite persistence adapter for mempill.
This crate provides the SQLite-backed implementation of the PersistencePort trait
defined in mempill-core. It owns the database schema (DDL + indexes), the
idempotent schema migration runner, and the full read + write path.
§Crate organisation
connection— connection lifecycle: open file or in-memory, apply mandatory PRAGMAs (journal_mode=WAL,synchronous=FULL,foreign_keys=ON), run migrations.migrations— deterministic, idempotent schema migration runner; embeds DDL viainclude_str!.txn—SqliteTxn: the concreteTxnhandle scoped to oneagent_id.store—SqlitePersistenceStore:impl PersistencePort— full read + write path.DefaultEngine— convenience type alias + constructors for the most common setup.
§PRAGMA contract (applied at connection open — before migrations or any DML)
PRAGMA journal_mode = WAL; -- concurrent reads during writes
PRAGMA synchronous = FULL; -- full-durability writes (mandatory; WAL+NORMAL can lose writes on power loss)
PRAGMA foreign_keys = ON; -- enforce FK constraints defined in DDL§DefaultEngine
For the common case (SQLite store, no oracle, no vector), use:
ⓘ
let engine = mempill_sqlite::open_default_in_memory();Re-exports§
pub use store::SqlitePendingStore;pub use store::SqlitePersistenceStore;
Modules§
- connection
- Connection lifecycle for mempill-sqlite.
- migrations
- Schema migration runner for mempill-sqlite.
- store
SqlitePersistenceStore— impl ofPersistencePortfor mempill-sqlite.- txn
SqliteTxn— the concrete transaction handle wrapping a rusqlite connection.
Enums§
- Sqlite
Store Error - Error type for all
mempill-sqliteoperations.
Traits§
- Oracle
Port - The oracle port — pull-based, non-blocking.
Functions§
- open_
default - Open a file-backed
DefaultEngineat the given path. - open_
default_ in_ memory - Open an in-memory
DefaultEngine. - open_
with_ oracle - Open a file-backed SQLite engine wired with a real oracle.
- open_
with_ oracle_ in_ memory - Open an in-memory SQLite engine wired with a real oracle.
Type Aliases§
- Default
Engine - The default concrete engine type: SQLite persistence, no oracle, no vector.
- Oracle
Engine - An
EngineHandlebacked by SQLite persistence, a caller-supplied oracle, and no vector.