mirror of
https://github.com/actix/examples
synced 2025-02-02 09:39:03 +01:00
fix 'startup connection+schema check' to work on empty database (#459)
Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
parent
11cd3f2b58
commit
e188d612c2
@ -44,7 +44,7 @@ async fn main() -> Result<()> {
|
|||||||
|
|
||||||
// startup connection+schema check
|
// startup connection+schema check
|
||||||
sqlx::query!("SELECT * FROM todos")
|
sqlx::query!("SELECT * FROM todos")
|
||||||
.fetch_one(&db_pool)
|
.fetch_optional(&db_pool)
|
||||||
.await
|
.await
|
||||||
.expect("no connection to database");
|
.expect("no connection to database");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user