Skip to content

Commit

Permalink
fix: implement AnyConnectionBackend::as_migrate for databases
Browse files Browse the repository at this point in the history
  • Loading branch information
cycraig authored and abonander committed Feb 22, 2023
1 parent a942f53 commit 9677430
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sqlx-mysql/src/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions sqlx-postgres/src/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions sqlx-sqlite/src/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9677430

Please sign in to comment.