Skip to main content

Crate mentat_sql

Crate mentat_sql 

Source

Structs§

Param
A borrowed SqlValue as a rusqlite parameter (a local newtype: both the trait and SqlValue are foreign to this crate).
RusqliteRow
SqlRow over a rusqlite row (a local newtype, for the orphan rule).
SQLQuery
We want to accumulate values that will later be substituted into a SQL statement execution. This struct encapsulates the generated string and the initial argument list. Additional user-supplied argument bindings, with their placeholders accumulated via push_bind_param, will be appended to this argument list.
SQLiteQueryBuilder
A QueryBuilder that implements SQLite’s specific escaping rules.
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).
SqliteConn
SqlConn for a rusqlite connection. rusqlite::Connection is foreign and so is the trait, so the impl is on this local wrapper; callers pass &SqliteConn(&conn), or use sqlite to get one.

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§

QueryBuilder
Gratefully based on Diesel’s QueryBuilder trait: https://github.com/diesel-rs/diesel/blob/4885f61b8205f7f3c2cfa03837ed6714831abe6b/diesel/src/query_builder/mod.rs#L56
QueryFragment
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.

Functions§

from_rusqlite
sql_error
A rusqlite error as the seam’s engine-neutral error.
sqlite
Wrap a rusqlite connection as a &dyn SqlConn-able value.
to_rusqlite