feat(plugins): support local JDBC plugin installation

Add a "local install" button that lets users install the JDBC plugin
from a local zip file when online download fails (e.g. draft release).
This commit is contained in:
t8y2 committed 2026-05-14 11:42:21 +08:00
1 parent 3c0d0fbad9
commit 081a356832
3 files changed
+43

No files matched your search

+11
View File
@@ -42,6 +42,17 @@ pub async fn install_jdbc_plugin(state: State<'_, Arc<AppState>>) -> Result<Jdbc
jdbc_plugin_status_from_state(&state)
}
#[tauri::command]
pub async fn install_jdbc_plugin_local(
state: State<'_, Arc<AppState>>,
path: String,
) -> Result<JdbcPluginStatus, String> {
let bytes = std::fs::read(&path).map_err(|e| format!("Failed to read file: {e}"))?;
let plugin_dir = state.plugins.root_dir().join("jdbc");
install_jdbc_plugin_zip(&bytes, &plugin_dir)?;
jdbc_plugin_status_from_state(&state)
}
#[tauri::command]
pub async fn uninstall_jdbc_plugin(state: State<'_, Arc<AppState>>) -> Result<JdbcPluginStatus, String> {
let plugin_dir = state.plugins.root_dir().join("jdbc");
+1
View File
@@ -93,6 +93,7 @@ pub fn run() {
commands::plugins::delete_jdbc_driver,
commands::plugins::jdbc_plugin_status,
commands::plugins::install_jdbc_plugin,
commands::plugins::install_jdbc_plugin_local,
commands::plugins::uninstall_jdbc_plugin,
commands::schema::list_databases,
commands::schema::list_tables,