Update to latest sqlx in example (#2099)

This commit is contained in:
David Pedersen
2023-07-16 13:49:53 +02:00
committed by GitHub
parent 4290955cf0
commit bb22802bfc
2 changed files with 3 additions and 4 deletions
+2 -3
View File
@@ -93,11 +93,10 @@ where
}
async fn using_connection_extractor(
DatabaseConnection(conn): DatabaseConnection,
DatabaseConnection(mut conn): DatabaseConnection,
) -> Result<String, (StatusCode, String)> {
let mut conn = conn;
sqlx::query_scalar("select 'hello world from pg'")
.fetch_one(&mut conn)
.fetch_one(&mut *conn)
.await
.map_err(internal_error)
}