pub trait Driver:
Send
+ Sync
+ 'static {
// Required methods
fn dialect(&self) -> &dyn Dialect;
fn query<'a>(
&'a self,
sql: &'a str,
params: &'a [SqlValue],
rows: &'a mut dyn RowSink,
) -> BoxFuture<'a, Result<()>>;
fn transaction(&self, steps: Vec<Step>) -> BoxFuture<'_, Result<()>>;
// Provided methods
fn lock_migrations(
&self,
) -> Option<BoxFuture<'_, Result<Box<dyn MigrationsLock>>>> { ... }
fn catalog(&self) -> Option<&dyn Catalog> { ... }
fn wakeups(&self) -> Option<BoxFuture<'_, Result<Box<dyn Wakeups>>>> { ... }
}Required Methods§
fn dialect(&self) -> &dyn Dialect
fn query<'a>( &'a self, sql: &'a str, params: &'a [SqlValue], rows: &'a mut dyn RowSink, ) -> BoxFuture<'a, Result<()>>
Sourcefn transaction(&self, steps: Vec<Step>) -> BoxFuture<'_, Result<()>>
fn transaction(&self, steps: Vec<Step>) -> BoxFuture<'_, Result<()>>
A unique-index refusal fails as Internal with a UniqueViolation source; a check,
exclusion or foreign key as Rule (check_refusal, exclusion_refusal, …).
Provided Methods§
Sourcefn lock_migrations(
&self,
) -> Option<BoxFuture<'_, Result<Box<dyn MigrationsLock>>>>
fn lock_migrations( &self, ) -> Option<BoxFuture<'_, Result<Box<dyn MigrationsLock>>>>
Held over a whole Schema::migrate until dropped; else each migration’s transaction locks.
fn catalog(&self) -> Option<&dyn Catalog>
fn wakeups(&self) -> Option<BoxFuture<'_, Result<Box<dyn Wakeups>>>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".