From ad48ec415cd74648d5f954df4e1f5e02a7acedfb Mon Sep 17 00:00:00 2001 From: TotallyNot <44345987+TotallyNot@users.noreply.github.com> Date: Sun, 13 Aug 2023 18:46:40 +0200 Subject: [PATCH] update sqlx to ^0.7 --- torn-key-pool/Cargo.toml | 6 +++--- torn-key-pool/src/postgres.rs | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/torn-key-pool/Cargo.toml b/torn-key-pool/Cargo.toml index d2df050..53df5d3 100644 --- a/torn-key-pool/Cargo.toml +++ b/torn-key-pool/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "torn-key-pool" -version = "0.6.1" +version = "0.6.2" edition = "2021" authors = ["Pyrit [2111649]"] license = "MIT" @@ -21,7 +21,7 @@ torn-api = { path = "../torn-api", default-features = false, version = "0.5.10" async-trait = "0.1" thiserror = "1" -sqlx = { version = "0.6", features = [ "postgres", "chrono", "json" ], optional = true } +sqlx = { version = "0.7", features = [ "postgres", "chrono", "json" ], optional = true } serde = { version = "1.0", optional = true } chrono = { version = "0.4", optional = true } indoc = { version = "1", optional = true } @@ -35,7 +35,7 @@ awc = { version = "3", default-features = false, optional = true } [dev-dependencies] torn-api = { path = "../torn-api", features = [ "reqwest" ] } -sqlx = { version = "0.6", features = [ "runtime-tokio-rustls" ] } +sqlx = { version = "0.7", features = [ "runtime-tokio-rustls" ] } dotenv = "0.15.0" tokio = { version = "1.24.2", features = ["test-util", "rt", "macros"] } tokio-test = "0.4.2" diff --git a/torn-key-pool/src/postgres.rs b/torn-key-pool/src/postgres.rs index c6c461f..8899259 100644 --- a/torn-key-pool/src/postgres.rs +++ b/torn-key-pool/src/postgres.rs @@ -205,7 +205,7 @@ where let mut tx = self.pool.begin().await?; sqlx::query("set transaction isolation level repeatable read") - .execute(&mut tx) + .execute(&mut *tx) .await?; let mut qb = QueryBuilder::new(indoc::indoc! { @@ -258,7 +258,7 @@ where api_keys.domains" }); - let key = qb.build_query_as().fetch_optional(&mut tx).await?; + let key = qb.build_query_as().fetch_optional(&mut *tx).await?; tx.commit().await?; @@ -307,7 +307,7 @@ where let mut tx = self.pool.begin().await?; sqlx::query("set transaction isolation level repeatable read") - .execute(&mut tx) + .execute(&mut *tx) .await?; let mut qb = QueryBuilder::new(indoc::indoc! { @@ -339,7 +339,7 @@ where qb.push("\norder by uses limit "); qb.push_bind(self.limit); - let mut keys: Vec = qb.build_query_as().fetch_all(&mut tx).await?; + let mut keys: Vec = qb.build_query_as().fetch_all(&mut *tx).await?; if keys.is_empty() { tx.commit().await?; @@ -383,7 +383,7 @@ where "#}) .bind(keys.iter().map(|k| k.id).collect::>()) .bind(keys.iter().map(|k| k.uses).collect::>()) - .execute(&mut tx) + .execute(&mut *tx) .await?; tx.commit().await?;