pub trait ToSql {
// Required methods
fn to_sql(&self) -> Result<SqlValue, TypeError>;
fn sql_type(&self) -> &'static str;
}Expand description
Trait for types that can be converted to SQL values.
This trait is implemented for common Rust types to enable type-safe parameter binding in queries.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl ToSql for DateTime<FixedOffset>
Available on crate feature chrono only.
impl ToSql for DateTime<FixedOffset>
Available on crate feature
chrono only.Source§impl ToSql for NaiveDateTime
Available on crate feature chrono only.
impl ToSql for NaiveDateTime
Available on crate feature
chrono only.