Skip to main content

DatabaseConnection

Trait DatabaseConnection 

Source
pub trait DatabaseConnection: Send + Sync {
    // Required methods
    fn execute_query<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        query: &'life1 str,
        params: &'life2 [&'life3 dyn DatabaseValue],
    ) -> Pin<Box<dyn Future<Output = Result<QueryResult, DatabaseError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn fetch_one<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        query: &'life1 str,
        params: &'life2 [&'life3 dyn DatabaseValue],
    ) -> Pin<Box<dyn Future<Output = Result<Row, DatabaseError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn fetch_all<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        query: &'life1 str,
        params: &'life2 [&'life3 dyn DatabaseValue],
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Row>, DatabaseError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

Database connection trait (abstraction over actual database)

Required Methods§

Source

fn execute_query<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, query: &'life1 str, params: &'life2 [&'life3 dyn DatabaseValue], ) -> Pin<Box<dyn Future<Output = Result<QueryResult, DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn fetch_one<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, query: &'life1 str, params: &'life2 [&'life3 dyn DatabaseValue], ) -> Pin<Box<dyn Future<Output = Result<Row, DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Source

fn fetch_all<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, query: &'life1 str, params: &'life2 [&'life3 dyn DatabaseValue], ) -> Pin<Box<dyn Future<Output = Result<Vec<Row>, DatabaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Implementors§