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};
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])
14 .build()
15}