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 Value
Serialize JSON Value
to text.
impl ToSql for Value
Serialize JSON Value
to text.
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
Source§impl ToSql for NaiveDate
ISO 8601 calendar date without timezone => “YYYY-MM-DD”
impl ToSql for NaiveDate
ISO 8601 calendar date without timezone => “YYYY-MM-DD”
fn to_sql(&self) -> Result<ToSqlOutput<'_>>
Source§impl ToSql for NaiveDateTime
ISO 8601 combined date and time without timezone =>
“YYYY-MM-DD HH:MM:SS.SSS”
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
ISO 8601 time without timezone => “HH:MM:SS.SSS”
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>
Date and time with time zone => UTC RFC3339 timestamp
(“YYYY-MM-DD HH:MM:SS.SSS+00:00”).
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”).