Skip to main content

tauri_plugin_mongoose/
lib.rs

1use tauri::{
2    plugin::{Builder, TauriPlugin},
3    Runtime,
4};
5
6pub mod db;
7mod commands;
8
9pub use db::{connect_to_db, get_client, is_connected, create_document, get_document_by_id, set_db_name, get_db_name, get_all_users, get_user_by_name, create_user};
10
11pub fn init<R: Runtime>() -> TauriPlugin<R> {
12    Builder::new("mongoose")
13        .invoke_handler(tauri::generate_handler![commands::connect, commands::create, commands::get_by_id, commands::get_users, commands::get_user, commands::create_db_user])
14        .build()
15}