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 lifetimeDB
: 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§
type Executor: Executor<'c, Database = DB> + 'c
type DatabaseDialect: DatabaseDialect
Required Methods§
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.