pub enum SqlValue {
Null,
Bool(bool),
Int(i64),
Float(f64),
Text(String),
Blob(Vec<u8>),
}Expand description
A SQL value that can be used as a parameter.
All values are properly escaped or parameterized to prevent SQL injection.
Variants§
Null
NULL value.
Bool(bool)
Boolean value.
Int(i64)
Integer value.
Float(f64)
Float value.
Text(String)
Text value.
Blob(Vec<u8>)
Binary blob value.
Implementations§
Source§impl SqlValue
impl SqlValue
Sourcepub fn to_sql_inline(&self) -> String
pub fn to_sql_inline(&self) -> String
Returns the SQL representation for inline use (escaped).
Warning: Prefer using parameterized queries instead.
Sourcepub const fn placeholder() -> &'static str
pub const fn placeholder() -> &'static str
Returns the parameter placeholder.
Trait Implementations§
Source§impl From<SqlValue> for ExprBuilder
impl From<SqlValue> for ExprBuilder
Source§impl ToSqlValue for SqlValue
impl ToSqlValue for SqlValue
Source§fn to_sql_value(self) -> SqlValue
fn to_sql_value(self) -> SqlValue
Converts the value to a
SqlValue.impl StructuralPartialEq for SqlValue
Auto Trait Implementations§
impl Freeze for SqlValue
impl RefUnwindSafe for SqlValue
impl Send for SqlValue
impl Sync for SqlValue
impl Unpin 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