Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix(gbase): detect offline GBase 8a driver

zipg9ef30e7f4da5
diff --git a/apps/desktop/src/lib/connection/agentDriverInstallHint.ts b/apps/desktop/src/lib/connection/agentDriverInstallHint.ts
index 7318dfe348..53c7ddd4c4 100644
--- a/apps/desktop/src/lib/connection/agentDriverInstallHint.ts
+++ b/apps/desktop/src/lib/connection/agentDriverInstallHint.ts
@@ -11,6 +11,7 @@ export function agentDriverInstallKey(dbType: DatabaseType | undefined, driverPr
if (dbType === "oracle") return "oracle";
if (dbType === "mongodb") return "mongodb";
if (dbType === "dameng") return "dameng";
+ if (dbType === "gbase") return driverProfile === "gbase8s" ? "gbase8s" : "gbase8a";
if (dbType === "mq") return driverProfile === "kafka" ? "kafka" : undefined;
return driverProfile && driverProfile !== dbType ? driverProfile : dbType;
}
diff --git a/packages/app-tests/agentDriverInstallHint.test.ts b/packages/app-tests/agentDriverInstallHint.test.ts
index 47532cd6a0..d8db77f953 100644
--- a/packages/app-tests/agentDriverInstallHint.test.ts
+++ b/packages/app-tests/agentDriverInstallHint.test.ts
@@ -1,6 +1,6 @@
import assert from "node:assert/strict";
import { test } from "vitest";
-import { appendAgentDriverUpdateHint, hasAgentDriverUpdate, showAgentDriverInstallHint } from "../../apps/desktop/src/lib/connection/agentDriverInstallHint.ts";
+import { agentDriverInstallKey, appendAgentDriverUpdateHint, hasAgentDriverUpdate, showAgentDriverInstallHint } from "../../apps/desktop/src/lib/connection/agentDriverInstallHint.ts";
test("hides the agent driver install hint when the selected driver is installed", () => {
assert.equal(showAgentDriverInstallHint("informix", [{ db_type: "informix", installed: true }]), false);
@@ -29,7 +29,25 @@ test("uses the unified Oracle driver for legacy Oracle profiles", () => {
assert.equal(showAgentDriverInstallHint("oracle", [{ db_type: "oracle", installed: false }], "oracle"), true);
});
-test("uses selected non-Oracle agent driver profiles for install hints", () => {
+test("uses the GBase 8a agent for generic, missing, and explicit 8a profiles", () => {
+ const drivers = [
+ { db_type: "gbase8a", installed: true },
+ { db_type: "gbase8s", installed: false },
+ ];
+
+ assert.equal(showAgentDriverInstallHint("gbase", drivers), false);
+ assert.equal(showAgentDriverInstallHint("gbase", drivers, "gbase"), false);
+ assert.equal(showAgentDriverInstallHint("gbase", drivers, "gbase8a"), false);
+});
+
+test("maps GBase profiles to their matching agent driver keys", () => {
+ assert.equal(agentDriverInstallKey("gbase"), "gbase8a");
+ assert.equal(agentDriverInstallKey("gbase", "gbase"), "gbase8a");
+ assert.equal(agentDriverInstallKey("gbase", "gbase8a"), "gbase8a");
+ assert.equal(agentDriverInstallKey("gbase", "gbase8s"), "gbase8s");
+});
+
+test("uses the selected GBase 8s agent for install hints", () => {
assert.equal(
showAgentDriverInstallHint(
"gbase",