Expand description

rusqlite::types::ToSql and rusqlite::types::FromSql implementations on crate::types. And the TypeTag & FromTypeTagAndSqlValue traits for reading for loading application types from a type-tag and SQLite value pair.

The TypeTag trait

Values are meant to be stored along with enough information to describe what corresponding rust type they were before serialized into the SQLite database.

For instance, we might store a date-time as an integer of the number of milliseconds from an epoch. But, when we get it back, we don’t want an integer, we want our date-time.

The type tag is in-band information that allows us to discriminate between integers and date-times, or other scalar types with the same SQLite representation. This way, users don’t need to know or expect anything about the type of what they’re querying and they should get the same values out as what was put in.

Another consideration for this feature is just to implement orderability properly. If I query date-times since A I don’t also want to search for integers greater than the integer representation of the date-time A.

Structs

Implements FromSqlRow for just one FromTypeTagAndSqlValue.

A single result row of a query.

Traits

A factory to make a FromSqlRow::Out from a rusqlite::Row using [FromSqlRow::/rom_start_of_row]. For example &[T] (where T implements FromSqlRow) also implements FromSqlRow where FromSqlRow::Out = Vec<<T as FromSqlRow>::Out>

Make Self from a type tag (i64) and a rusqlite::types::ValueRef.

See the module level documentation in crate::driver about this.

Functions

Type Definitions

A typedef of the result returned by many methods.