sea_orm

Trait ProxyDatabaseTrait

Source
pub trait ProxyDatabaseTrait:
    Send
    + Sync
    + Debug {
    // Required methods
    fn query<'life0, 'async_trait>(
        &'life0 self,
        statement: Statement,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ProxyRow>, DbErr>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        statement: Statement,
    ) -> Pin<Box<dyn Future<Output = Result<ProxyExecResult, DbErr>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn begin<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn commit<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn rollback<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn ping<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Available on crate feature proxy only.
Expand description

Defines the ProxyDatabaseTrait to save the functions

Required Methods§

Source

fn query<'life0, 'async_trait>( &'life0 self, statement: Statement, ) -> Pin<Box<dyn Future<Output = Result<Vec<ProxyRow>, DbErr>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute a query in the [ProxyDatabase], and return the query results

Source

fn execute<'life0, 'async_trait>( &'life0 self, statement: Statement, ) -> Pin<Box<dyn Future<Output = Result<ProxyExecResult, DbErr>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute a command in the [ProxyDatabase], and report the number of rows affected

Provided Methods§

Source

fn begin<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Begin a transaction in the [ProxyDatabase]

Source

fn commit<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Commit a transaction in the [ProxyDatabase]

Source

fn rollback<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Rollback a transaction in the [ProxyDatabase]

Source

fn ping<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Ping the [ProxyDatabase], it should return an error if the database is not available

Implementors§