pub trait ToSqlx {
type Target;
// Required method
fn to_sqlx(self) -> Self::Target;
}
Expand description
A trait for convenient conversions from Jiff types to SQLx types.
§Example
This shows how to convert a jiff::Timestamp
to a Timestamp
:
use jiff_sqlx::ToSqlx;
let ts: jiff::Timestamp = "2025-02-20T17:00-05".parse()?;
let wrapper = ts.to_sqlx();
assert_eq!(format!("{wrapper:?}"), "Timestamp(2025-02-20T22:00:00Z)");