chore(server): scaffold axum com health endpoint e testes
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
use rusqlite::Connection;
|
||||
use crate::config::Config;
|
||||
use crate::error::AppResult;
|
||||
|
||||
pub fn open(cfg: &Config) -> AppResult<Connection> {
|
||||
if let Some(parent) = std::path::Path::new(&cfg.db_path).parent() {
|
||||
std::fs::create_dir_all(parent).ok();
|
||||
}
|
||||
let db = Connection::open(&cfg.db_path)?;
|
||||
db.pragma_update(None, "journal_mode", "WAL")?;
|
||||
db.pragma_update(None, "synchronous", "NORMAL")?;
|
||||
Ok(db)
|
||||
}
|
||||
Reference in New Issue
Block a user