pub trait BindValues: Database {
// Required methods
fn push_bind_value(query_builder: &mut QueryBuilder<'_, Self>, value: Value);
fn push_bind_value_unseparated<Sep: Display>(
separated: &mut Separated<'_, '_, Self, Sep>,
value: Value,
);
}Expand description
A database the SQL helpers can write for.
It is one whose driver binds every raw value a domain model may filter on
or store (Value’s variants: bool, i16, i32, i64, f32, f64,
String and the chrono date/time types, each possibly NULL).
Implemented for every such sqlx database: Postgres, MySQL/MariaDB and
SQLite, with sqlx’s chrono feature (sqlx::Any is not one, having no
date/time types). Code generic over the database only needs
DB: BindValues.
Required Methods§
Sourcefn push_bind_value(query_builder: &mut QueryBuilder<'_, Self>, value: Value)
fn push_bind_value(query_builder: &mut QueryBuilder<'_, Self>, value: Value)
Bind value with its own SQL type; an absent value binds as a NULL
of that type.
Sourcefn push_bind_value_unseparated<Sep: Display>(
separated: &mut Separated<'_, '_, Self, Sep>,
value: Value,
)
fn push_bind_value_unseparated<Sep: Display>( separated: &mut Separated<'_, '_, Self, Sep>, value: Value, )
Bind value like BindValues::push_bind_value, into a separated
list without a separator before it (e.g. right after column = ).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".