pub trait ConnectionTrait: Sync {
    fn get_database_backend(&self) -> DatabaseBackend;
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        stmt: Statement
    ) -> Pin<Box<dyn Future<Output = Result<ExecResult, DbErr>> + Send + 'async_trait, Global>>Notable traits for Pin<P>impl<P> Future for Pin<P> where
    P: DerefMut,
    <P as Deref>::Target: Future
type Output = <<P as Deref>::Target as Future>::Output;

    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn query_one<'life0, 'async_trait>(
        &'life0 self,
        stmt: Statement
    ) -> Pin<Box<dyn Future<Output = Result<Option<QueryResult>, DbErr>> + Send + 'async_trait, Global>>Notable traits for Pin<P>impl<P> Future for Pin<P> where
    P: DerefMut,
    <P as Deref>::Target: Future
type Output = <<P as Deref>::Target as Future>::Output;

    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn query_all<'life0, 'async_trait>(
        &'life0 self,
        stmt: Statement
    ) -> Pin<Box<dyn Future<Output = Result<Vec<QueryResult, Global>, DbErr>> + Send + 'async_trait, Global>>Notable traits for Pin<P>impl<P> Future for Pin<P> where
    P: DerefMut,
    <P as Deref>::Target: Future
type Output = <<P as Deref>::Target as Future>::Output;

    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn support_returning(&self) -> bool { ... } fn is_mock_connection(&self) -> bool { ... } }
Expand description

Creates constraints for any structure that can create a database connection and execute SQL statements

Required methods

Fetch the database backend as specified in DbBackend. This depends on feature flags enabled.

Execute a Statement

Execute a Statement and return a query

Execute a Statement and return a collection Vec<QueryResult> on success

Provided methods

Check if the connection supports RETURNING syntax on insert and update

Check if the connection is a test connection for the Mock database

Implementors