pub trait ToSql {
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
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
Converts Rust value to SQLite value
Implementations on Foreign Types
sourceimpl ToSql for NaiveDate
This is supported on crate feature chrono
only.
impl ToSql for NaiveDate
This is supported on crate feature
chrono
only.ISO 8601 calendar date without timezone => “YYYY-MM-DD”
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
sourceimpl ToSql for NaiveTime
This is supported on crate feature chrono
only.
impl ToSql for NaiveTime
This is supported on crate feature
chrono
only.ISO 8601 time without timezone => “HH:MM:SS.SSS”
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
sourceimpl ToSql for NaiveDateTime
This is supported on crate feature chrono
only.
impl ToSql for NaiveDateTime
This is supported on crate feature
chrono
only.ISO 8601 combined date and time without timezone => “YYYY-MM-DD HH:MM:SS.SSS”
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
sourceimpl ToSql for DateTime<Utc>
This is supported on crate feature chrono
only.
impl ToSql for DateTime<Utc>
This is supported on crate feature
chrono
only.UTC time => UTC RFC3339 timestamp (“YYYY-MM-DD HH:MM:SS.SSS+00:00”).
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
sourceimpl ToSql for DateTime<Local>
This is supported on crate feature chrono
only.
impl ToSql for DateTime<Local>
This is supported on crate feature
chrono
only.Local time => UTC RFC3339 timestamp (“YYYY-MM-DD HH:MM:SS.SSS+00:00”).
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
sourceimpl ToSql for DateTime<FixedOffset>
This is supported on crate feature chrono
only.
impl ToSql for DateTime<FixedOffset>
This is supported on crate feature
chrono
only.Date and time with time zone => RFC3339 timestamp (“YYYY-MM-DD HH:MM:SS.SSS[+-]HH:MM”).
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
sourceimpl ToSql for Value
This is supported on crate feature serde_json
only.
impl ToSql for Value
This is supported on crate feature
serde_json
only.Serialize JSON Value
to text.
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
sourceimpl ToSql for OffsetDateTime
This is supported on crate feature time
only.
impl ToSql for OffsetDateTime
This is supported on crate feature
time
only.fn to_sql(&self) -> Result<ToSqlOutput<'_>>
sourceimpl<T: ToSql + ToOwned + ?Sized> ToSql for Cow<'_, T>
impl<T: ToSql + ToOwned + ?Sized> ToSql for Cow<'_, T>
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
sourceimpl<T: ?Sized> ToSql for &T where
T: ToSql,
impl<T: ?Sized> ToSql for &T where
T: ToSql,
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
sourceimpl ToSql for Url
This is supported on crate feature url
only.
impl ToSql for Url
This is supported on crate feature
url
only.Serialize Url
to text.