Skip to content

Commit

Permalink
fix: install default drivers before sqlx-cli create/drop
Browse files Browse the repository at this point in the history
  • Loading branch information
cycraig authored and Aandreba committed Mar 31, 2023
1 parent d7bda7a commit cc4fae7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sqlx-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ pub async fn run(opt: Opt) -> Result<()> {

/// Attempt to connect to the database server, retrying up to `ops.connect_timeout`.
async fn connect(opts: &ConnectOpts) -> sqlx::Result<AnyConnection> {
sqlx::any::install_default_drivers();

retry_connect_errors(opts, AnyConnection::connect).await
}

Expand All @@ -97,6 +95,8 @@ where
F: FnMut(&'a str) -> Fut,
Fut: Future<Output = sqlx::Result<T>> + 'a,
{
sqlx::any::install_default_drivers();

backoff::future::retry(
backoff::ExponentialBackoffBuilder::new()
.with_max_elapsed_time(Some(Duration::from_secs(opts.connect_timeout)))
Expand Down

0 comments on commit cc4fae7

Please sign in to comment.