pub trait ToSql {
// Required method
fn to_sql(&self) -> Result<ToSqlOutput<'_>>;
}
Expand description
A trait for types that can be converted into DuckDB values. Returns
[Error::ToSqlConversionFailure
] if the conversion fails.
Required Methods§
sourcefn to_sql(&self) -> Result<ToSqlOutput<'_>>
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
Converts Rust value to DuckDB value
Implementations on Foreign Types§
source§impl ToSql for NaiveDate
impl ToSql for NaiveDate
ISO 8601 calendar date without timezone => “YYYY-MM-DD”
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
source§impl ToSql for NaiveDateTime
impl ToSql for NaiveDateTime
ISO 8601 combined date and time without timezone => “YYYY-MM-DD HH:MM:SS.SSS”
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
source§impl ToSql for NaiveTime
impl ToSql for NaiveTime
ISO 8601 time without timezone => “HH:MM:SS.SSS”
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
source§impl<T: ToSql + ToOwned + ?Sized> ToSql for Cow<'_, T>
impl<T: ToSql + ToOwned + ?Sized> ToSql for Cow<'_, T>
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
source§impl<Tz: TimeZone> ToSql for DateTime<Tz>
impl<Tz: TimeZone> ToSql for DateTime<Tz>
Date and time with time zone => UTC RFC3339 timestamp (“YYYY-MM-DD HH:MM:SS.SSS+00:00”).