fix: implement AnyConnectionBackend::as_migrate for databases

This commit is contained in:
Craig Bester 2023-02-22 12:17:49 +02:00 committed by Austin Bonander
parent a942f5316e
commit 9677430d67
3 changed files with 21 additions and 0 deletions

View file

@ -62,6 +62,13 @@ impl AnyConnectionBackend for MySqlConnection {
Connection::should_flush(self)
}
#[cfg(feature = "migrate")]
fn as_migrate(
&mut self,
) -> sqlx_core::Result<&mut (dyn sqlx_core::migrate::Migrate + Send + 'static)> {
Ok(self)
}
fn fetch_many<'q>(
&'q mut self,
query: &'q str,

View file

@ -65,6 +65,13 @@ impl AnyConnectionBackend for PgConnection {
Connection::should_flush(self)
}
#[cfg(feature = "migrate")]
fn as_migrate(
&mut self,
) -> sqlx_core::Result<&mut (dyn sqlx_core::migrate::Migrate + Send + 'static)> {
Ok(self)
}
fn fetch_many<'q>(
&'q mut self,
query: &'q str,

View file

@ -67,6 +67,13 @@ impl AnyConnectionBackend for SqliteConnection {
Connection::should_flush(self)
}
#[cfg(feature = "migrate")]
fn as_migrate(
&mut self,
) -> sqlx_core::Result<&mut (dyn sqlx_core::migrate::Migrate + Send + 'static)> {
Ok(self)
}
fn fetch_many<'q>(
&'q mut self,
query: &'q str,