Skip to main content

Database

Trait Database 

Source
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§

Source

fn database_type(&self) -> DatabaseType

Get the database type

Source

fn name(&self) -> &str

Get the database name

Source

fn type_mapping(&self) -> &dyn TypeMapping

Get the type mapping implementation

Source

fn sql_generator(&self) -> &dyn SqlGenerator

Get the SQL generator implementation

Source

fn introspector(&self) -> &dyn Introspector

Get the introspector implementation

Source

fn connection_manager(&self) -> &dyn ConnectionManager

Get the connection manager implementation

Source

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".

Implementors§