pub enum SqlValue {
Null,
Bool(bool),
Integer(i64),
Float(f64),
Text(String),
Blob(Vec<u8>),
Json(Value),
Uuid(Uuid),
Timestamp(DateTime<Utc>),
}Expand description
A tagged SQL column value that can round-trip through serde and SQLite bindings.
Variants§
Null
Bool(bool)
Integer(i64)
Float(f64)
Text(String)
Blob(Vec<u8>)
Json(Value)
Uuid(Uuid)
Timestamp(DateTime<Utc>)
Implementations§
Source§impl SqlValue
impl SqlValue
Sourcepub fn from_opt_text(value: Option<&str>) -> SqlValue
pub fn from_opt_text(value: Option<&str>) -> SqlValue
Bind optional text: Some becomes SqlValue::Text, including the empty
string, and None becomes SqlValue::Null.
Sourcepub fn from_opt_i64(value: Option<i64>) -> SqlValue
pub fn from_opt_i64(value: Option<i64>) -> SqlValue
Bind an optional integer: Some becomes SqlValue::Integer, including
zero, and None becomes SqlValue::Null.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SqlValue
impl<'de> Deserialize<'de> for SqlValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SqlValue
impl RefUnwindSafe for SqlValue
impl Send for SqlValue
impl Sync for SqlValue
impl Unpin for SqlValue
impl UnsafeUnpin for SqlValue
impl UnwindSafe 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
Mutably borrows from an owned value. Read more