pub enum SqlValue {
Show 22 variants
Bool(bool),
Int(i64),
BigInt(i64),
Float(f64),
String(String),
Bytes(Vec<u8>),
Uuid(Uuid),
DateTime(DateTime<Utc>),
Json(Value),
Decimal(Box<dyn DecimalLike>),
Vector(Vec<f32>),
NullBool,
NullInt,
NullBigInt,
NullFloat,
NullString,
NullBytes,
NullUuid,
NullDateTime,
NullJson,
NullDecimal,
NullVector,
}Variants§
Bool(bool)
Int(i64)
BigInt(i64)
A BigInt field’s value (ADR 0019). Bound as INT8 on Postgres
and stored as an SQLite INTEGER, exactly like SqlValue::Int in
this release. A variant of its own, rather than reusing Int, so
the next release can narrow Int to 32 bits without touching any
BigInt call site, and so a comparison between the two is an
explicit decision (cratestack-sqlx compares them numerically)
rather than the derived PartialEq, which treats them as different.
Float(f64)
String(String)
Bytes(Vec<u8>)
Uuid(Uuid)
DateTime(DateTime<Utc>)
Json(Value)
Decimal(Box<dyn DecimalLike>)
Holds whichever concrete decimal type the originating schema chose
(cratestack#505 Direction 2 — rust_decimal::Decimal,
bigdecimal::BigDecimal, or any other DecimalLike
implementer), boxed rather than a fixed concrete type so two
schemas that chose different backends can share this one compiled
SqlValue without a Cargo-feature union collision. Unconditional —
no #[cfg] gate, since this variant no longer names a concrete
backend type at all.
Vector(Vec<f32>)
A Vector(n) field’s value (see docs/design/extensions.md
§6). Defined unconditionally — no pgvector dependency is
needed to hold a Vec<f32> — but only ever constructed by
generated code gated on the pgvector Cargo feature (#161’s
compile-time check), and only ever bound to a real column by
cratestack-sqlx’s own pgvector-gated encode path.