Trait db_pool::async::BackendTrait

source ·
pub trait BackendTrait: Sized + Send + Sync + 'static {
    type Pool: Send;
    type BuildError: Debug + Send;
    type PoolError: Debug + Send;
    type ConnectionError: Debug;
    type QueryError: Debug;

    // Required methods
    fn init<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<(), Error<Self::BuildError, Self::PoolError, Self::ConnectionError, Self::QueryError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn create<'life0, 'async_trait>(
        &'life0 self,
        db_id: Uuid,
        restrict_privileges: bool
    ) -> Pin<Box<dyn Future<Output = Result<Self::Pool, Error<Self::BuildError, Self::PoolError, Self::ConnectionError, Self::QueryError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn clean<'life0, 'async_trait>(
        &'life0 self,
        db_id: Uuid
    ) -> Pin<Box<dyn Future<Output = Result<(), Error<Self::BuildError, Self::PoolError, Self::ConnectionError, Self::QueryError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn drop<'life0, 'async_trait>(
        &'life0 self,
        db_id: Uuid,
        is_restricted: bool
    ) -> Pin<Box<dyn Future<Output = Result<(), Error<Self::BuildError, Self::PoolError, Self::ConnectionError, Self::QueryError>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Backend trait

Required Associated Types§

source

type Pool: Send

Connection pool type that implements Send

source

type BuildError: Debug + Send

Connection pool build error type that implements Debug and Send

source

type PoolError: Debug + Send

Connection pool error type that implements Debug and Send

source

type ConnectionError: Debug

Connection error type that implements Debug

source

type QueryError: Debug

Query error type that implements Debug

Required Methods§

source

fn init<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Error<Self::BuildError, Self::PoolError, Self::ConnectionError, Self::QueryError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Initializes the backend

source

fn create<'life0, 'async_trait>( &'life0 self, db_id: Uuid, restrict_privileges: bool ) -> Pin<Box<dyn Future<Output = Result<Self::Pool, Error<Self::BuildError, Self::PoolError, Self::ConnectionError, Self::QueryError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Creates a database

source

fn clean<'life0, 'async_trait>( &'life0 self, db_id: Uuid ) -> Pin<Box<dyn Future<Output = Result<(), Error<Self::BuildError, Self::PoolError, Self::ConnectionError, Self::QueryError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Cleans a database

source

fn drop<'life0, 'async_trait>( &'life0 self, db_id: Uuid, is_restricted: bool ) -> Pin<Box<dyn Future<Output = Result<(), Error<Self::BuildError, Self::PoolError, Self::ConnectionError, Self::QueryError>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Drops a database

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Backend for SeaORMMySQLBackend

§

type Pool = DatabaseConnection

§

type BuildError = BuildError

§

type PoolError = PoolError

§

type ConnectionError = ConnectionError

§

type QueryError = QueryError

source§

impl Backend for SeaORMPostgresBackend

§

type Pool = DatabaseConnection

§

type BuildError = BuildError

§

type PoolError = PoolError

§

type ConnectionError = ConnectionError

§

type QueryError = QueryError

source§

impl Backend for SqlxMySQLBackend

§

type Pool = Pool<MySql>

§

type BuildError = BuildError

§

type PoolError = PoolError

§

type ConnectionError = ConnectionError

§

type QueryError = QueryError

source§

impl Backend for SqlxPostgresBackend

§

type Pool = Pool<Postgres>

§

type BuildError = BuildError

§

type PoolError = PoolError

§

type ConnectionError = ConnectionError

§

type QueryError = QueryError

source§

impl<P: DieselPoolAssociation<AsyncMysqlConnection>> Backend for DieselAsyncMySQLBackend<P>

§

type Pool = <P as DieselPoolAssociation<AsyncMysqlConnection>>::Pool

§

type BuildError = <P as DieselPoolAssociation<AsyncMysqlConnection>>::BuildError

§

type PoolError = <P as DieselPoolAssociation<AsyncMysqlConnection>>::PoolError

§

type ConnectionError = ConnectionError

§

type QueryError = Error

source§

impl<P: DieselPoolAssociation<AsyncPgConnection>> Backend for DieselAsyncPostgresBackend<P>

§

type Pool = <P as DieselPoolAssociation<AsyncPgConnection>>::Pool

§

type BuildError = <P as DieselPoolAssociation<AsyncPgConnection>>::BuildError

§

type PoolError = <P as DieselPoolAssociation<AsyncPgConnection>>::PoolError

§

type ConnectionError = ConnectionError

§

type QueryError = Error

source§

impl<P: TokioPostgresPoolAssociation> Backend for TokioPostgresBackend<P>

§

type Pool = <P as TokioPostgresPoolAssociation>::Pool

§

type BuildError = <P as TokioPostgresPoolAssociation>::BuildError

§

type PoolError = <P as TokioPostgresPoolAssociation>::PoolError

§

type ConnectionError = ConnectionError

§

type QueryError = QueryError