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§

source

type Entity: SqLiteEntity

Entity type returned by the result cursor.

Required Methods§

source

fn filters(&self) -> WhereCondition

Return the filters to apply to the query.

source

fn get_definition(&self, condition: &str) -> String

Return the definition of this query, ie the actual SQL this query performs.

Implementors§