Enum SqlValue
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.
NullBool
NullInt
NullBigInt
NullFloat
NullString
NullBytes
NullUuid
NullDateTime
NullJson
NullDecimal
NullVector
Trait Implementations§
impl StructuralPartialEq for SqlValue
Auto Trait Implementations§
impl !RefUnwindSafe for SqlValue
impl !UnwindSafe for SqlValue
impl Freeze for SqlValue
impl Send for SqlValue
impl Sync for SqlValue
impl Unpin for SqlValue
impl UnsafeUnpin for SqlValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more