mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-25 00:00:23 +02:00
Update to latest sqlx in example (#2099)
This commit is contained in:
@@ -10,4 +10,4 @@ tokio = { version = "1.0", features = ["full"] }
|
|||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||||
|
|
||||||
sqlx = { version = "0.6.3", features = ["runtime-tokio-rustls", "any", "postgres"] }
|
sqlx = { version = "0.7", features = ["runtime-tokio-rustls", "any", "postgres"] }
|
||||||
|
|||||||
@@ -93,11 +93,10 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn using_connection_extractor(
|
async fn using_connection_extractor(
|
||||||
DatabaseConnection(conn): DatabaseConnection,
|
DatabaseConnection(mut conn): DatabaseConnection,
|
||||||
) -> Result<String, (StatusCode, String)> {
|
) -> Result<String, (StatusCode, String)> {
|
||||||
let mut conn = conn;
|
|
||||||
sqlx::query_scalar("select 'hello world from pg'")
|
sqlx::query_scalar("select 'hello world from pg'")
|
||||||
.fetch_one(&mut conn)
|
.fetch_one(&mut *conn)
|
||||||
.await
|
.await
|
||||||
.map_err(internal_error)
|
.map_err(internal_error)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user