feat(db): add Db handle with pool connect and readiness ping
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
use db::Db;
|
||||
use sqlx::PgPool;
|
||||
|
||||
#[sqlx::test]
|
||||
async fn ping_succeeds(pool: PgPool) {
|
||||
let db = Db::from_pool(pool);
|
||||
db.ping()
|
||||
.await
|
||||
.expect("ping should succeed against a live database");
|
||||
}
|
||||
Reference in New Issue
Block a user