Trait rusqlite::types::ToSql

source ·
pub trait ToSql {
    // Required method
    fn to_sql(&self) -> Result<ToSqlOutput<'_>>;
}
Expand description

A trait for types that can be converted into SQLite values. Returns Error::ToSqlConversionFailure if the conversion fails.

Required Methods§

source

fn to_sql(&self) -> Result<ToSqlOutput<'_>>

Converts Rust value to SQLite value

Implementations on Foreign Types§

source§

impl ToSql for str

source§

impl ToSql for Url

Available on crate feature url only.

Serialize Url to text.

source§

impl ToSql for u32

source§

impl ToSql for DateTime<Local>

Available on crate feature chrono only.

Local time => UTC RFC3339 timestamp (“YYYY-MM-DD HH:MM:SS.SSS+00:00”).

source§

impl ToSql for f64

source§

impl ToSql for DateTime<Utc>

Available on crate feature chrono only.

UTC time => UTC RFC3339 timestamp (“YYYY-MM-DD HH:MM:SS.SSS+00:00”).

source§

impl ToSql for i8

source§

impl ToSql for u64

source§

impl ToSql for usize

source§

impl ToSql for u8

source§

impl ToSql for String

source§

impl<T: ToSql + ?Sized> ToSql for Rc<T>

source§

impl ToSql for Vec<u8>

source§

impl ToSql for i16

source§

impl ToSql for f32

source§

impl ToSql for i128

source§

impl ToSql for bool

source§

impl ToSql for Value

Available on crate feature serde_json only.

Serialize JSON Value to text:

JSONSQLite
NullNULL
Bool‘true’ / ‘false’
NumberINT or REAL except u64
_TEXT
source§

impl<T: ToSql> ToSql for Option<T>

source§

impl ToSql for NaiveTime

Available on crate feature chrono only.

ISO 8601 time without timezone => “HH:MM:SS.SSS”

source§

impl ToSql for NaiveDate

Available on crate feature chrono only.

ISO 8601 calendar date without timezone => “YYYY-MM-DD”

source§

impl<T: ToSql + ToOwned + ?Sized> ToSql for Cow<'_, T>

source§

impl<T: ToSql + ?Sized> ToSql for Box<T>

source§

impl<const N: usize> ToSql for [u8; N]

source§

impl ToSql for u16

source§

impl ToSql for isize

source§

impl ToSql for i32

source§

impl ToSql for Uuid

source§

impl ToSql for i64

source§

impl<T> ToSql for &Twhere T: ToSql + ?Sized,

source§

impl ToSql for NaiveDateTime

Available on crate feature chrono only.

ISO 8601 combined date and time without timezone => “YYYY-MM-DD HH:MM:SS.SSS”

source§

impl ToSql for OffsetDateTime

Available on crate feature time only.
source§

impl<T: ToSql + ?Sized> ToSql for Arc<T>

source§

impl ToSql for [u8]

source§

impl ToSql for DateTime<FixedOffset>

Available on crate feature chrono only.

Date and time with time zone => RFC3339 timestamp (“YYYY-MM-DD HH:MM:SS.SSS[+-]HH:MM”).

Implementors§

source§

impl ToSql for ToSqlOutput<'_>

source§

impl ToSql for rusqlite::types::Value

source§

impl ToSql for ZeroBlob

Available on crate feature blob only.
source§

impl ToSql for Null

source§

impl ToSql for Array

Available on crate features array and vtab only.