BackendDB

Trait BackendDB 

Source
pub trait BackendDB<'c, DB>
where DB: Database,
{ type Executor: Executor<'c, Database = DB> + 'c; type DatabaseDialect: DatabaseDialect; // Required method fn backend_db( self, ) -> impl Future<Output = Result<(Self::DatabaseDialect, Self::Executor), Error>> + Send; }
Expand description

Trait for database connections/pools that can detect their backend type

§Type Parameters

  • 'c: Connection lifetime
  • DB: Database type implementing [sqlx::Database]

§Required Implementations

Automatically implemented for types that:

§Provided Methods

backend_db: Default implementation using the module-level function

Required Associated Types§

Required Methods§

Source

fn backend_db( self, ) -> impl Future<Output = Result<(Self::DatabaseDialect, Self::Executor), Error>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'c, DB, C, C1> BackendDB<'c, DB> for C
where DB: Database, C: Executor<'c, Database = DB> + 'c + Deref<Target = C1>, C1: Any, for<'c1> &'c1 mut DB::Connection: Executor<'c1, Database = DB>,