Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
944 changes: 502 additions & 442 deletions Cargo.lock

Large diffs are not rendered by default.

18 changes: 13 additions & 5 deletions benches/sqlite/describe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@ use criterion::BenchmarkId;
use criterion::Criterion;
use criterion::{criterion_group, criterion_main};

use sqlx::sql_str::AssertSqlSafe;
use sqlx::sqlite::{Sqlite, SqliteConnection};
use sqlx::Executor;
use sqlx_test::new;

// Here we have an async function to benchmark
async fn do_describe_trivial(db: &std::cell::RefCell<SqliteConnection>) {
db.borrow_mut().describe("select 1").await.unwrap();
db.borrow_mut()
.describe(AssertSqlSafe("select 1"))
.await
.unwrap();
}

async fn do_describe_recursive(db: &std::cell::RefCell<SqliteConnection>) {
db.borrow_mut()
.describe(
.describe(AssertSqlSafe(
r#"
WITH RECURSIVE schedule(begin_date) AS MATERIALIZED (
SELECT datetime('2022-10-01')
Expand All @@ -28,21 +32,25 @@ async fn do_describe_recursive(db: &std::cell::RefCell<SqliteConnection>) {
FROM schedule
GROUP BY begin_date
"#,
)
))
.await
.unwrap();
}

async fn do_describe_insert(db: &std::cell::RefCell<SqliteConnection>) {
db.borrow_mut()
.describe("INSERT INTO tweet (id, text) VALUES (2, 'Hello') RETURNING *")
.describe(AssertSqlSafe(
"INSERT INTO tweet (id, text) VALUES (2, 'Hello') RETURNING *",
))
.await
.unwrap();
}

async fn do_describe_insert_fks(db: &std::cell::RefCell<SqliteConnection>) {
db.borrow_mut()
.describe("insert into statements (text) values ('a') returning id")
.describe(AssertSqlSafe(
"insert into statements (text) values ('a') returning id",
))
.await
.unwrap();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/mysql/todos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ workspace = "../../../"
anyhow = "1.0"
sqlx = { path = "../../../", features = [ "mysql", "runtime-tokio", "tls-native-tls" ] }
clap = { version = "4", features = ["derive"] }
tokio = { version = "1.20.0", features = ["rt", "macros"]}
tokio = { version = "1.47", features = ["rt", "macros"]}
4 changes: 2 additions & 2 deletions examples/postgres/axum-social-with-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ edition = "2021"
# Primary crates
axum = { version = "0.5.13", features = ["macros"] }
sqlx = { path = "../../../", features = [ "runtime-tokio", "tls-rustls-ring", "postgres", "time", "uuid" ] }
tokio = { version = "1.20.1", features = ["rt-multi-thread", "macros"] }
tokio = { version = "1.47", features = ["rt-multi-thread", "macros"] }

# Important secondary crates
argon2 = "0.4.1"
Expand All @@ -19,7 +19,7 @@ serde = "1.0.140"
serde_with = { version = "2.0.0", features = ["time_0_3"] }
time = "0.3.11"
uuid = { version = "1.1.2", features = ["serde"] }
validator = { version = "0.16.0", features = ["derive"] }
validator = { version = "0.20", features = ["derive"] }

# Auxilliary crates
anyhow = "1.0.58"
Expand Down
2 changes: 1 addition & 1 deletion examples/postgres/axum-social-with-tests/src/http/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static USERNAME_REGEX: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"^[0-9A-Za
#[derive(Deserialize, Validate)]
#[serde(rename_all = "camelCase")]
pub struct UserAuth {
#[validate(length(min = 3, max = 16), regex = "USERNAME_REGEX")]
#[validate(length(min = 3, max = 16), regex(path = *USERNAME_REGEX))]
username: String,
#[validate(length(min = 8, max = 32))]
password: String,
Expand Down
1 change: 1 addition & 0 deletions examples/postgres/mockable-todos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ tokio = { version = "1.20.0", features = ["rt", "macros"]}
dotenvy = "0.15.0"
async-trait = "0.1.41"
mockall = "0.11"
async-std = "1.12"
2 changes: 1 addition & 1 deletion examples/postgres/multi-database/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tokio = { version = "1", features = ["rt-multi-thread", "macros"] }

color-eyre = "0.6.3"
dotenvy = "0.15.7"
tracing-subscriber = "0.3.19"
tracing-subscriber = "0.3.20"

rust_decimal = "1.36.0"

Expand Down
2 changes: 1 addition & 1 deletion examples/postgres/multi-tenant/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tokio = { version = "1", features = ["rt-multi-thread", "macros"] }

color-eyre = "0.6.3"
dotenvy = "0.15.7"
tracing-subscriber = "0.3.19"
tracing-subscriber = "0.3.20"

rust_decimal = "1.36.0"

Expand Down
1 change: 1 addition & 0 deletions sqlx-macros-core/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use proc_macro2::Span;
use std::env;
use std::path::{Path, PathBuf};

#[allow(dead_code)]
pub(crate) fn resolve_path(path: impl AsRef<Path>, err_span: Span) -> syn::Result<PathBuf> {
let path = path.as_ref();

Expand Down
Loading