auto-copiar alpha.db al Desktop cada vez que se ejecuta la app

This commit is contained in:
2026-05-27 18:07:15 -05:00
parent b141be345a
commit 7c52a32877
+8
View File
@@ -301,6 +301,14 @@ async fn get_conn(db_path: &str) -> Result<libsql::Connection, String> {
.await
.map_err(|e| format!("Migration: {e}"))?;
// Copiar DB al Desktop para acceso rápido con DBeaver
let _ = std::fs::copy(
db_path,
dirs_next::desktop_dir()
.unwrap_or_else(|| std::path::PathBuf::from("."))
.join("alpha.db"),
);
Ok(conn)
}