migrar Alpha a Tauri app con Turso/libsql como BD local

This commit is contained in:
Ricardo Gonzalez
2026-05-25 21:37:31 -05:00
parent ee5db5b67e
commit c8bc002b7d
14 changed files with 11569 additions and 1 deletions
+32
View File
@@ -0,0 +1,32 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
mod db;
use db::commands;
use std::sync::Mutex;
fn main() {
let db_path = {
let path = dirs_next::config_dir()
.unwrap_or_else(|| std::path::PathBuf::from("."))
.join("com.teloprax.alpha")
.join("alpha.db");
std::fs::create_dir_all(path.parent().unwrap()).ok();
path.to_str().unwrap().to_string()
};
tauri::Builder::default()
.plugin(tauri_plugin_opener::init())
.manage(Mutex::new(db_path))
.invoke_handler(tauri::generate_handler![
commands::get_projects,
commands::save_project,
commands::delete_project,
commands::get_work_items,
commands::save_work_item,
commands::delete_work_item,
])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}