pub trait Backend<R, E> where
    E: From<ToqlError>, 
{ fn registry(
        &self
    ) -> Result<RwLockReadGuard<'_, TableMapperRegistry>, ToqlError>; fn registry_mut(
        &mut self
    ) -> Result<RwLockWriteGuard<'_, TableMapperRegistry>, ToqlError>; fn roles(&self) -> &HashSet<String>; fn alias_format(&self) -> AliasFormat; fn aux_params(&self) -> &HashMap<String, SqlArg>; fn select_sql<'life0, 'async_trait>(
        &'life0 mut self,
        sql: Sql
    ) -> Pin<Box<dyn Future<Output = Result<Vec<R>, E>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn prepare_page(&self, result: &mut BuildResult, page: &Page); fn select_max_page_size_sql<'life0, 'async_trait>(
        &'life0 mut self,
        sql: Sql
    ) -> Pin<Box<dyn Future<Output = Result<u64, E>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn select_count_sql<'life0, 'async_trait>(
        &'life0 mut self,
        sql: Sql
    ) -> Pin<Box<dyn Future<Output = Result<u64, E>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn execute_sql<'life0, 'async_trait>(
        &'life0 mut self,
        sql: Sql
    ) -> Pin<Box<dyn Future<Output = Result<(), E>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn insert_sql<'life0, 'async_trait>(
        &'life0 mut self,
        sql: Sql
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SqlArg>, E>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }
Expand description

Backend interface that must be implemented by databases to use the default Toql functions. The Backend is implemented for a Row and Error type It contains database specific callbacks for database independend functions

Required Methods

Return the registry with all table mappers

Return a mutable registry with all table mappers

Return roles. These will be used for any role restrictions

Return the active alias format. It is used to build all SQL aliases

Return the aux params. These will be used together with the query aux params to resolve aux params in SQL expressions and handlers

Execute a select statement on the database and return a vector of rows

Modify a builder result, so that page can be loaded This is different for each database LIMIT on MySql or LIMIT OFFSET on Postgres, etc.

Implementors