Skip to main content

UpdateQueryBook

Trait UpdateQueryBook 

Source
pub trait UpdateQueryBook<T: SqlEntity>: QueryBook<T> {
    // Provided methods
    fn get_sql_definition(&self) -> &'static str { ... }
    fn update<'a>(
        &self,
        updates: HashMap<&'a str, &'a dyn ToSqlAny>,
        conditions: WhereCondition<'a>,
    ) -> SqlQuery<'a, T> { ... }
}
Expand description

A trait that marks QueryBooks that perform simple aSQL update queries These queries actually return the updated entities.

Provided Methods§

Source

fn get_sql_definition(&self) -> &'static str

Definition of the delete query.

Source

fn update<'a>( &self, updates: HashMap<&'a str, &'a dyn ToSqlAny>, conditions: WhereCondition<'a>, ) -> SqlQuery<'a, T>

Create a new update query with the given updates and conditions. 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 updates will be the updates passed to the method. The conditions will be the conditions passed to the method. The projection will be the projection of the entity returned by the get_projection method.

Implementors§