update sqlx to ^0.7

This commit is contained in:
TotallyNot 2023-08-13 18:46:40 +02:00
parent 29639a69aa
commit 2182204e05
2 changed files with 8 additions and 8 deletions

View file

@ -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"

View file

@ -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<Self::Key> = qb.build_query_as().fetch_all(&mut tx).await?;
let mut keys: Vec<Self::Key> = 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::<Vec<_>>())
.bind(keys.iter().map(|k| k.uses).collect::<Vec<_>>())
.execute(&mut tx)
.execute(&mut *tx)
.await?;
tx.commit().await?;