From 4aa907d8b5208a17461ade48e9466fc999b0bb85 Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Thu, 18 Jun 2026 01:45:33 +0800 Subject: [PATCH] fix: handle legacy gbase driver_profile and add MCP driver_profile param --- apps/desktop/src/lib/jdbcDialect.ts | 13 ++++++++----- packages/mcp-server/src/index.ts | 4 +++- src-tauri/src/commands/transfer.rs | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/desktop/src/lib/jdbcDialect.ts b/apps/desktop/src/lib/jdbcDialect.ts index ba3245cc9..a7a9132c3 100644 --- a/apps/desktop/src/lib/jdbcDialect.ts +++ b/apps/desktop/src/lib/jdbcDialect.ts @@ -28,15 +28,15 @@ export function inferJdbcDialect(connection?: JdbcDialectConnection): DatabaseTy export function effectiveDatabaseTypeForConnection(connection?: JdbcDialectConnection): DatabaseType | undefined { if (!connection) return undefined; - if (connection.db_type === "gbase" && connection.driver_profile === "gbase8a") return "mysql"; - if (connection.db_type === "gbase" && connection.driver_profile === "gbase8s") return "informix"; + if (connection.db_type === "gbase" && isGbase8sProfile(connection.driver_profile)) return "informix"; + if (connection.db_type === "gbase") return "mysql"; if (connection.db_type !== "jdbc") return connection.db_type; return inferJdbcDialect(connection) ?? "jdbc"; } export function tableStructureDatabaseTypeForConnection(connection?: JdbcDialectConnection): DatabaseType | undefined { if (!connection) return undefined; - if (connection.db_type === "gbase" && connection.driver_profile === "gbase8a") return "gbase"; + if (connection.db_type === "gbase" && !isGbase8sProfile(connection.driver_profile)) return "gbase"; return effectiveDatabaseTypeForConnection(connection); } @@ -55,14 +55,13 @@ export function connectionUsesSchemaExecutionContext(connection?: Pick { + async ({ name, db_type, host, port, username, password, database, ssl, driver_profile }) => { const existing = await backend.findConnection(name); if (existing) return text(`Connection "${name}" already exists.`); const DEFAULT_PORTS: Record = { @@ -189,6 +190,7 @@ export function createDbxMcpServer(backend: Backend, options: { isWebMode?: bool password, database, ssl, + driver_profile, ssh_enabled: false, } as Omit); await notifyReload(); diff --git a/src-tauri/src/commands/transfer.rs b/src-tauri/src/commands/transfer.rs index 032f12f75..cb663b9d6 100644 --- a/src-tauri/src/commands/transfer.rs +++ b/src-tauri/src/commands/transfer.rs @@ -268,6 +268,7 @@ pub async fn cancel_transfer(transfer_id: String) -> Result<(), String> { /// Sort table names by foreign key dependency. /// `parents_first: true` → parent tables first (insert/export order). /// `parents_first: false` → child tables first (drop order). +#[allow(dead_code)] #[tauri::command] pub async fn sort_tables_by_fk_dependency( state: tauri::State<'_, std::sync::Arc>,