pub trait Database: Send + Sync {
// Required methods
fn database_type(&self) -> DatabaseType;
fn name(&self) -> &str;
fn type_mapping(&self) -> &dyn TypeMapping;
fn sql_generator(&self) -> &dyn SqlGenerator;
fn introspector(&self) -> &dyn Introspector;
fn connection_manager(&self) -> &dyn ConnectionManager;
fn migration_manager(&self) -> &dyn MigrationManager;
}Expand description
Core database abstraction trait
This trait defines the interface that all database implementations must provide. It serves as the central point of abstraction for multi-platform support.
Required Methods§
Sourcefn database_type(&self) -> DatabaseType
fn database_type(&self) -> DatabaseType
Get the database type
Sourcefn type_mapping(&self) -> &dyn TypeMapping
fn type_mapping(&self) -> &dyn TypeMapping
Get the type mapping implementation
Sourcefn sql_generator(&self) -> &dyn SqlGenerator
fn sql_generator(&self) -> &dyn SqlGenerator
Get the SQL generator implementation
Sourcefn introspector(&self) -> &dyn Introspector
fn introspector(&self) -> &dyn Introspector
Get the introspector implementation
Sourcefn connection_manager(&self) -> &dyn ConnectionManager
fn connection_manager(&self) -> &dyn ConnectionManager
Get the connection manager implementation
Sourcefn migration_manager(&self) -> &dyn MigrationManager
fn migration_manager(&self) -> &dyn MigrationManager
Get the migration manager implementation
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".