use crate::database::migrations::baseline;
use crate::database::versions::source;
use crate::database::DatabaseConnection;
pub(super) async fn connect() -> DatabaseConnection {
match baseline::connect().await {
Ok(connection) => connection,
Err(error) => {
super::report::fail(&error.to_string());
unreachable!("fail exits the process")
}
}
}
pub(super) fn up_sql(version: &str) -> Vec<String> {
match source::up(version) {
Ok(sql) => sql,
Err(error) => {
super::report::fail(&error.to_string());
unreachable!("fail exits the process")
}
}
}