pub trait IDatabaseProvider: Send + Sync {
// Required methods
fn sql_generator(&self) -> &'static dyn ISqlGenerator;
fn get_connection<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = EFResult<Box<dyn IAsyncConnection>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn execute_migration_command<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
) -> Pin<Box<dyn Future<Output = EFResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn name(&self) -> &str;
fn migration_dialect(&self) -> MigrationDialect;
}Expand description
The database provider abstraction. Corresponds to EFCore’s provider model.
Required Methods§
Sourcefn sql_generator(&self) -> &'static dyn ISqlGenerator
fn sql_generator(&self) -> &'static dyn ISqlGenerator
Returns the SQL dialect generator for this provider.
Implementations are stateless, so a &'static reference is returned —
no heap allocation per call.
Sourcefn get_connection<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = EFResult<Box<dyn IAsyncConnection>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_connection<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = EFResult<Box<dyn IAsyncConnection>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets an async database connection from the pool.
Sourcefn execute_migration_command<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
) -> Pin<Box<dyn Future<Output = EFResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute_migration_command<'life0, 'life1, 'async_trait>(
&'life0 self,
sql: &'life1 str,
) -> Pin<Box<dyn Future<Output = EFResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Executes a migration command (DDL).
Sourcefn migration_dialect(&self) -> MigrationDialect
fn migration_dialect(&self) -> MigrationDialect
Returns the migration dialect for this provider.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".