Skip to main content

tauri_plugin_mongoose/
lib.rs

1use tauri::{
2    plugin::{Builder, TauriPlugin},
3    Runtime,
4};
5
6mod commands;
7pub mod db;
8
9pub use db::{
10    connect_to_db, create_document, create_user, delete_one_document, find_documents,
11    find_one_document, get_all_users, get_client, get_db_name, get_document_by_id, get_file_url,
12    get_user_by_name, is_connected, save_file, set_db_name, SaveFileRequest,
13};
14
15pub fn init<R: Runtime>() -> TauriPlugin<R> {
16    Builder::new("mongoose")
17        .invoke_handler(tauri::generate_handler![
18            commands::connect,
19            commands::create,
20            commands::get_by_id,
21            commands::get_users,
22            commands::get_user,
23            commands::create_db_user,
24            commands::find,
25            commands::find_one,
26            commands::update_one,
27            commands::delete_one,
28            commands::save_file,
29            commands::get_file_url
30        ])
31        .build()
32}