#[non_exhaustive]pub enum DbValue {
}Expand description
A value bound to a query parameter.
SQLite stores booleans as 0/1 and dates as text; PostgreSQL gets them
with their own types (BOOLEAN, TIMESTAMPTZ, TIMESTAMP, DATE,
TIME), so the same model works on both.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Null
SQL NULL.
Integer(i64)
A 64-bit integer (INTEGER on SQLite, BIGINT on PostgreSQL).
Real(f64)
A 64-bit float (REAL on SQLite, DOUBLE PRECISION on PostgreSQL).
Text(String)
Text.
Blob(Vec<u8>)
Bytes (BLOB on SQLite, BYTEA on PostgreSQL).
Bool(bool)
A boolean (0/1 on SQLite, BOOLEAN on PostgreSQL).
DateTime(DateTime<FixedOffset>)
A point in time with its offset (TIMESTAMPTZ on PostgreSQL).
NaiveDateTime(NaiveDateTime)
A date and time without a zone (TIMESTAMP on PostgreSQL).
Date(NaiveDate)
A date (YYYY-MM-DD text on SQLite, DATE on PostgreSQL).
Time(NaiveTime)
A time of day (text on SQLite, TIME on PostgreSQL).
Json(Value)
Text on SQLite; JSON on PostgreSQL (fits JSONB and TEXT columns).
Uuid(Uuid)
A 16-byte BLOB on SQLite; UUID on PostgreSQL.
Encrypted(Unsealed)
An Encrypted field’s value, sealed with the
database’s key when the statement runs (text in the column).
Trait Implementations§
impl StructuralPartialEq for DbValue
Auto Trait Implementations§
impl Freeze for DbValue
impl RefUnwindSafe for DbValue
impl Send for DbValue
impl Sync for DbValue
impl Unpin for DbValue
impl UnsafeUnpin for DbValue
impl UnwindSafe for DbValue
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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