Skip to main content

Module conn

Module conn 

Source
Expand description

The storage seam: the few SQL operations the mentat engine (transactor, query runner, projector, pull) needs from a database, so the same engine can run on SQLite (the CLI and library) and on DuckDB (the DuckDB extension).

mentat_sql::SqliteConn implements SqlConn over a rusqlite::Connection, keeping its statement cache, so the SQLite path runs the same SQL it always has. Where another engine needs different SQL, callers branch on SqlConn::dialect.

Structs§

SqlError
An error from the underlying database, carried as text so the trait stays engine-neutral. sqlite_code is set for SQLite errors that callers inspect (e.g. a constraint violation).

Enums§

Dialect
Which SQL dialect a connection speaks. The engine’s SQL is SQLite’s; a handful of statements (DDL, temp tables, fulltext) differ on DuckDB.
SqlValue
A SQL value as the engine stores it: SQLite’s five storage classes. DuckDB maps these onto the members of its v column’s UNION type.

Traits§

SqlConn
The SQL operations the engine needs. Positional parameters are ?; named parameters ($name, used by the query builder) go through SqlConn::query_named.
SqlConnExt
Convenience helpers over any SqlConn.
SqlRow
One result row. Columns are 0-based.