sql-values
sql-values holds the semantics of SQL values. It ports PostgreSQL's own value rules (input, canonical output, order, arithmetic and the explicit cast of a literal), each checked against PostgreSQL 18, and it reads the text forms PostgreSQL, MySQL and SQLite emit for scalar values, so every wire-text consumer decodes the same spelling to the same Rust value. Dates and times are held as PostgreSQL stores them, over its whole range, and timestamptz arithmetic runs in a named time zone from jiff's bundled IANA database.
use ;
assert_eq!;
let span = parse_interval.unwrap;
assert_eq!;
assert_eq!;
let at = parse_timestamp.unwrap;
let day = parse_interval.unwrap;
assert_eq!;
let rome = parse.unwrap;
let noon = parse.unwrap;
let before = day.subtract_from_timestamptz.unwrap;
assert_eq!;
let level = cast_literal.unwrap;
assert_eq!;
The crate supports no_std. Decimal parsing is available through the decimal feature, conversions to and from jiff's date and time types through the jiff feature, and serde derives for interval, date and time values through the serde feature.