feat(connection): close database scoped pools

This commit is contained in:
t8y2 committed 2026-05-30 12:34:14 +08:00
1 parent 4724686dd3
commit 13d52514d9
13 files changed
+150 -7

No files matched your search

+11
View File
@@ -515,6 +515,17 @@ pub async fn disconnect_db(state: State<'_, Arc<AppState>>, connection_id: Strin
Ok(())
}
#[tauri::command]
pub async fn close_database_connection(
state: State<'_, Arc<AppState>>,
connection_id: String,
database: String,
) -> Result<bool, String> {
let database = database.trim();
let database = if database.is_empty() { None } else { Some(database) };
state.close_database_pool(&connection_id, database).await
}
#[tauri::command]
pub async fn refresh_connections(state: State<'_, Arc<AppState>>) -> Result<(), String> {
state.refresh_connections().await;