pub struct SqliteBackend { /* private fields */ }Expand description
A SQLite-backed Backend using bundled rusqlite (no system libsqlite3).
Implementations§
Source§impl SqliteBackend
impl SqliteBackend
Sourcepub fn open(path: &Path) -> Result<Self>
pub fn open(path: &Path) -> Result<Self>
Open (or create) a SQLite database at path, in WAL mode with a busy
timeout so co-located processes serialize cleanly rather than erroring.
Sourcepub fn from_connection(conn: Connection) -> Self
pub fn from_connection(conn: Connection) -> Self
Wrap a connection a consumer already owns — the incremental-adoption
seam. A consumer (newt’s ConversationStore, modulex’s Store) that
already holds a rusqlite::Connection hands it over, keeps running its
own domain SQL through SqliteBackend::connection, and gets the
agent-store primitives on the same database: no second connection, no
big-bang rewrite. Pragmas are the caller’s responsibility here (the
connection is assumed already configured).
Sourcepub fn connection(&self) -> &Connection
pub fn connection(&self) -> &Connection
Borrow the underlying SQLite connection for backend-specific
(domain-table) SQL. SQLite-only by nature — the Backend trait stays
the portable, backend-agnostic surface; this escape hatch is how a
consumer keeps its existing rusqlite code while adopting the substrate.