add tauri-sqlite and guest module
This commit is contained in:
753
src-tauri/Cargo.lock
generated
753
src-tauri/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -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
9
src-tauri/src/actions.rs
Normal 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)
|
||||
}
|
@@ -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)
|
||||
}
|
@@ -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");
|
||||
}
|
||||
|
Reference in New Issue
Block a user