chore(server): scaffold axum com health endpoint e testes

This commit is contained in:
2026-08-05 20:23:09 -03:00
parent bfe12ba7ae
commit bc4de69ab9
11 changed files with 2013 additions and 0 deletions
+13
View File
@@ -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)
}