mempill-sqlite
SQLite persistence adapter for mempill (topology-a).
See the repository README for the full architecture, quick start, and invariants.
What this crate provides
SqlitePersistenceStore—impl PersistencePortbacked by a single rusqlite connection.DefaultEngine— type alias forEngineHandle<SqlitePersistenceStore, NoOpOracle, NoOpVector>.open_default(path)— open a file-backed engine at the given path.open_default_in_memory()— open an ephemeral in-memory engine (tests, MCP sessions).
Usage
use open_default_in_memory;
use ;
use ;
async
PRAGMA contract
Applied at connection open, before any DML:
PRAGMA journal_mode = WAL;
PRAGMA synchronous = FULL; -- mandatory: WAL+NORMAL can lose writes on power loss
PRAGMA foreign_keys = ON;
When to use SQLite vs PostgreSQL
- Single-agent deployment, embedded library, tests, MCP sessions → SQLite (this crate)
- Multi-agent shared database, production service → mempill-postgres
Both adapters implement the same PersistencePort trait and are proven behaviorally
identical by the shared conformance harness.
License
Apache-2.0. See LICENSE for the full text.