This commit is contained in:
2025-08-16 10:41:26 +02:00
parent 5eab3b080c
commit f8dd304820
3 changed files with 99 additions and 137 deletions

View File

@@ -42,6 +42,13 @@ impl Server {
let db_file_path = std::path::PathBuf::from(self.option.dir.clone())
.join(format!("{}.db", self.selected_db));
// Ensure the directory exists before creating the database file
if let Some(parent_dir) = db_file_path.parent() {
std::fs::create_dir_all(parent_dir).map_err(|e| {
DBError(format!("Failed to create directory {}: {}", parent_dir.display(), e))
})?;
}
println!("Creating new db file: {}", db_file_path.display());
let storage = Arc::new(Storage::new(