summaryrefslogtreecommitdiff
path: root/src/services/db.rs
blob: a8e49187b842ca2a4b016d2681e624a384ef3fbf (plain)
use exun::*;
use sqlx::MySqlPool;

/// Intialize the connection pool
pub async fn initialize(db: &str, user: &str, password: &str) -> Result<MySqlPool, RawUnexpected> {
	let url = format!("mysql://{user}:{password}@localhost/{db}");
	MySqlPool::connect(&url).await.unexpect()
}