Skip to main content

ReadQueryBook

Trait ReadQueryBook 

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

A trait that marks QueryBooks that perform simple select {:projection:} from {:source:} where {:condition:} queries.

Provided Methods§

Source

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

Return the definition of the SQL query. It could be a select statement or an insert statement or a update statement or a delete statement.

Source

fn select<'a>(&self, conditions: WhereCondition<'a>) -> SqlQuery<'a, T>

Create a new select query with the given conditions. The query will be built using the definition returned by the get_sql_definition method. The projection will be the projection of the entity returned by the get_projection method. The source will be the source returned by the get_sql_source method.

Implementors§