From cc4fae775dc1c9fd3b07c2d5dc55142945444d34 Mon Sep 17 00:00:00 2001 From: Craig Bester Date: Wed, 22 Feb 2023 12:16:48 +0200 Subject: [PATCH] fix: install default drivers before sqlx-cli create/drop --- sqlx-cli/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sqlx-cli/src/lib.rs b/sqlx-cli/src/lib.rs index 696391b85d..bc03149a2e 100644 --- a/sqlx-cli/src/lib.rs +++ b/sqlx-cli/src/lib.rs @@ -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 { - sqlx::any::install_default_drivers(); - retry_connect_errors(opts, AnyConnection::connect).await } @@ -97,6 +95,8 @@ where F: FnMut(&'a str) -> Fut, Fut: Future> + 'a, { + sqlx::any::install_default_drivers(); + backoff::future::retry( backoff::ExponentialBackoffBuilder::new() .with_max_elapsed_time(Some(Duration::from_secs(opts.connect_timeout)))