pub trait ToSql {
// Required methods
fn to_sql(&self) -> Result<SqlValue, TypeError>;
fn sql_type(&self) -> &'static str;
// Provided method
fn decimal_param_info(&self) -> Option<DecimalParamInfo> { ... }
}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§
Provided Methods§
Sourcefn decimal_param_info(&self) -> Option<DecimalParamInfo>
fn decimal_param_info(&self) -> Option<DecimalParamInfo>
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.Implementors§
impl ToSql for Money
Available on crate feature
decimal only.impl ToSql for Numeric
Available on crate feature
decimal only.impl ToSql for SmallDateTime
Available on crate feature
chrono only.impl ToSql for SmallMoney
Available on crate feature
decimal only.