add tauri-sqlite and guest module

This commit is contained in:
2024-12-09 23:16:29 +01:00
parent ce8c259d1b
commit da2f4c5e06
8 changed files with 779 additions and 7 deletions

753
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -22,4 +22,5 @@ tauri = { version = "2", features = [] }
tauri-plugin-shell = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tauri-plugin-sql = "2.2.0"

9
src-tauri/src/actions.rs Normal file
View File

@@ -0,0 +1,9 @@
#[tauri::command]
pub fn wave(name: &str) -> String {
format!("Hello, {}! You've been waved from Rust, with a different file!", name)
}
#[tauri::command]
pub fn greet(name: &str) -> String {
format!("Hello, {}! You've been greeted from Rust, with a different file!", name)
}

View File

@@ -1,4 +0,0 @@
#[tauri::command]
pub fn greet(name: &str) -> String {
format!("Hello, {}! You've been greeted from Rust, with a different file!", name)
}

View File

@@ -1,11 +1,12 @@
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
mod handlers;
mod actions;
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_shell::init())
.invoke_handler(tauri::generate_handler![handlers::greet])
.plugin(tauri_plugin_sql::Builder::default().build())
.invoke_handler(tauri::generate_handler![actions::greet, actions::wave])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}