use sea_orm::DatabaseConnection; async fn connect_db() -> DatabaseConnection { let database_url = "sqlite://./database/dev.db"; let db_connection = sea_orm::Database::connect(database_url) .await .expect("Could not connect to database"); db_connection } #[cfg(test)] mod tests { use std::{thread, time::Duration}; use crate::connect_db; #[tokio::test] async fn test_db_conn() { let db = connect_db().await; println!("Connected to database"); thread::sleep(Duration::from_millis(3000)); _ = db.close().await; println!("Connection Closed") } }