pub trait Database:
Sized
+ 'static
+ Send
+ Debug
+ for<'r> HasValueRef<'r, Database = Self>
+ for<'q> HasArguments<'q, Database = Self>
+ for<'q> HasStatement<'q, Database = Self> {
type Connection: Connection<Database = Self>;
type TransactionManager: TransactionManager<Database = Self>;
type Row: Row<Database = Self>;
type QueryResult: 'static + Send + Sync + Default + Extend<Self::QueryResult>;
type Column: Column<Database = Self>;
type TypeInfo: TypeInfo;
type Value: Value<Database = Self> + 'static;
const NAME: &'static str;
const URL_SCHEMES: &'static [&'static str];
}
Expand description
A database driver.
This trait encapsulates a complete set of traits that implement a driver for a specific database (e.g., MySQL, PostgreSQL).
Required Associated Constantsยง
Sourceconst URL_SCHEMES: &'static [&'static str]
const URL_SCHEMES: &'static [&'static str]
The schemes for database URLs that should match this driver.
Required Associated Typesยง
Sourcetype Connection: Connection<Database = Self>
type Connection: Connection<Database = Self>
The concrete Connection
implementation for this database.
Sourcetype TransactionManager: TransactionManager<Database = Self>
type TransactionManager: TransactionManager<Database = Self>
The concrete TransactionManager
implementation for this database.
Sourcetype QueryResult: 'static + Send + Sync + Default + Extend<Self::QueryResult>
type QueryResult: 'static + Send + Sync + Default + Extend<Self::QueryResult>
The concrete QueryResult
implementation for this database.
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.