use std::path::PathBuf; use heromodels::db::hero::OurDB; /// The path to the database file. Change this as needed for your environment. pub const DB_PATH: &str = "/tmp/freezone_db"; /// Returns a shared OurDB instance for the given path. You can wrap this in Arc/Mutex for concurrent access if needed. pub fn get_db() -> Result { let db_path = PathBuf::from(DB_PATH); if let Some(parent) = db_path.parent() { let _ = std::fs::create_dir_all(parent); } // Temporarily reset the database to fix the serialization issue let db = heromodels::db::hero::OurDB::new(db_path, false).expect("Can create DB"); Ok(db) }