chrono.rs |
Convert most of the [Time Strings](http://sqlite.org/lang_datefunc.html) to chrono types. |
10890 |
from_sql.rs |
|
11235 |
mod.rs |
Traits dealing with SQLite data types.
SQLite uses a [dynamic type system](https://www.sqlite.org/datatype3.html). Implementations of
the [`ToSql`] and [`FromSql`] traits are provided for the basic types that
SQLite provides methods for:
* Strings (`String` and `&str`)
* Blobs (`Vec<u8>` and `&[u8]`)
* Numbers
The number situation is a little complicated due to the fact that all
numbers in SQLite are stored as `INTEGER` (`i64`) or `REAL` (`f64`).
[`ToSql`] and [`FromSql`] are implemented for all primitive number types.
[`FromSql`] has different behaviour depending on the SQL and Rust types, and
the value.
* `INTEGER` to integer: returns an
[`Error::IntegralValueOutOfRange`](crate::Error::IntegralValueOutOfRange)
error if the value does not fit in the Rust type.
* `REAL` to integer: always returns an
[`Error::InvalidColumnType`](crate::Error::InvalidColumnType) error.
* `INTEGER` to float: casts using `as` operator. Never fails.
* `REAL` to float: casts using `as` operator. Never fails.
[`ToSql`] always succeeds except when storing a `u64` or `usize` value that
cannot fit in an `INTEGER` (`i64`). Also note that SQLite ignores column
types, so if you store an `i64` in a column with type `REAL` it will be
stored as an `INTEGER`, not a `REAL` (unless the column is part of a
[STRICT table](https://www.sqlite.org/stricttables.html)).
If the `time` feature is enabled, implementations are
provided for `time::OffsetDateTime` that use the RFC 3339 date/time format,
`"%Y-%m-%dT%H:%M:%S.%fZ"`, to store time values as strings. These values
can be parsed by SQLite's builtin
[datetime](https://www.sqlite.org/lang_datefunc.html) functions. If you
want different storage for datetimes, you can use a newtype. |
15806 |
serde_json.rs |
[`ToSql`] and [`FromSql`] implementation for JSON `Value`. |
4540 |
time.rs |
Convert formats 1-10 in [Time Values](https://sqlite.org/lang_datefunc.html#time_values) to time types.
[`ToSql`] and [`FromSql`] implementation for [`time::OffsetDateTime`].
[`ToSql`] and [`FromSql`] implementation for [`time::PrimitiveDateTime`].
[`ToSql`] and [`FromSql`] implementation for [`time::Date`].
[`ToSql`] and [`FromSql`] implementation for [`time::Time`].
Time Strings in:
- Format 2: "YYYY-MM-DD HH:MM"
- Format 5: "YYYY-MM-DDTHH:MM"
- Format 8: "HH:MM"
without an explicit second value will assume 0 seconds.
Time String that contain an optional timezone without an explicit date are unsupported.
All other assumptions described in [Time Values](https://sqlite.org/lang_datefunc.html#time_values) section are unsupported. |
15332 |
to_sql.rs |
|
15279 |
url.rs |
[`ToSql`] and [`FromSql`] implementation for [`url::Url`]. |
2598 |
value.rs |
|
2960 |
value_ref.rs |
|
8737 |