Trait mithril_persistence::sqlite::Query
source · pub trait Query {
type Entity: SqLiteEntity;
// Required methods
fn filters(&self) -> WhereCondition;
fn get_definition(&self, condition: &str) -> String;
}
Expand description
Define a query to perform on database and return iterator of a defined entity.
Used as a parameter of fetch.
It aims at being easily testable and adaptable.
Required Associated Types§
sourcetype Entity: SqLiteEntity
type Entity: SqLiteEntity
Entity type returned by the result cursor.
Required Methods§
sourcefn filters(&self) -> WhereCondition
fn filters(&self) -> WhereCondition
Return the filters to apply to the query.
sourcefn get_definition(&self, condition: &str) -> String
fn get_definition(&self, condition: &str) -> String
Return the definition of this query, ie the actual SQL this query performs.