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_codeis 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
vcolumn’sUNIONtype.
Traits§
- SqlConn
- The SQL operations the engine needs. Positional parameters are
?; named parameters ($name, used by the query builder) go throughSqlConn::query_named. - SqlConn
Ext - Convenience helpers over any
SqlConn. - SqlRow
- One result row. Columns are 0-based.