pub trait InsertQueryBook<T: SqlEntity>: QueryBook<T> {
// Provided methods
fn get_sql_definition(&self) -> &'static str { ... }
fn insert<'a>(
&self,
values: HashMap<&'a str, &'a dyn ToSqlAny>,
) -> SqlQuery<'a, T> { ... }
}Expand description
A trait that marks QueryBooks that perform SQL insert queries. These queries actually return the inserted entities.
Provided Methods§
Sourcefn get_sql_definition(&self) -> &'static str
fn get_sql_definition(&self) -> &'static str
Definition of the insert query.
Sourcefn insert<'a>(
&self,
values: HashMap<&'a str, &'a dyn ToSqlAny>,
) -> SqlQuery<'a, T>
fn insert<'a>( &self, values: HashMap<&'a str, &'a dyn ToSqlAny>, ) -> SqlQuery<'a, T>
Create a new insert query with the given values.
The query will be built using the definition returned by the get_sql_definition method.
The source will be the source returned by the get_sql_source method.
The structure will be the structure of the entity returned by the get_structure method.
The values will be the values passed to the method.
The projection will be the projection of the entity returned by the get_projection method.