Open trevyn opened 3 years ago
Also incoming soon: SQLite STRICT
tables:
https://www.sqlite.org/draft/stricttables.html
Doesn't directly support BOOLEAN
, but other than that pretty nice. Note that derived columns should still be runtime typechecked!
SQLite is flexibly typed, a philosophy which doesn't harmonize well with Rust's preference for strong types.
Despite this flexible typing, SQLite provides access to the underlying type of result columns of individual rows, and
rusqlite
exposes this via, for example:rusqlite::Row::columns()
rusqlite::Column::decl_type()
rusqlite::Row::get_raw()
rusqlite::types::ValueRef
These can be used to enforce additional typechecking at runtime, instead of the usual behavior of coercing types.