Files
AstralRinth/src/health/status.rs
2022-02-27 21:44:00 -07:00

17 lines
306 B
Rust

use actix_web::web;
use sqlx::PgPool;
pub async fn test_database(
postgres: web::Data<PgPool>,
) -> Result<(), sqlx::Error> {
let mut transaction = postgres.acquire().await?;
sqlx::query(
"
SELECT 1
",
)
.execute(&mut transaction)
.await
.map(|_| ())
}