Skip to content

Commit

Permalink
Update to latest sqlx in example (#2099)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpdrsn committed Jul 16, 2023
1 parent 4290955 commit bb22802
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/sqlx-postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ tokio = { version = "1.0", features = ["full"] }
tracing = "0.1"
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"] }
5 changes: 2 additions & 3 deletions examples/sqlx-postgres/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit bb22802

Please sign in to comment.