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(connection): respect oracle driver profile hints

t8y2370701a82b4e
diff --git a/apps/desktop/src/components/connection/ConnectionDialog.vue b/apps/desktop/src/components/connection/ConnectionDialog.vue
index 9e890b006c..d77657d170 100644
--- a/apps/desktop/src/components/connection/ConnectionDialog.vue
+++ b/apps/desktop/src/components/connection/ConnectionDialog.vue
@@ -552,7 +552,7 @@ const canUseProxy = computed(
() => form.value.db_type !== "sqlite" && form.value.db_type !== "duckdb" && form.value.db_type !== "access",
);
const shouldShowAgentDriverInstallHint = computed(() =>
- showAgentDriverInstallHint(form.value.db_type, agentDrivers.value),
+ showAgentDriverInstallHint(form.value.db_type, agentDrivers.value, selectedType.value),
);
const testResultMessage = computed(() => {
if (!testResult.value) return "";
diff --git a/apps/desktop/src/lib/agentDriverInstallHint.ts b/apps/desktop/src/lib/agentDriverInstallHint.ts
index 809bbc086c..c79cddc504 100644
--- a/apps/desktop/src/lib/agentDriverInstallHint.ts
+++ b/apps/desktop/src/lib/agentDriverInstallHint.ts
@@ -9,7 +9,9 @@ export interface AgentDriverInstallState {
export function showAgentDriverInstallHint(
dbType: DatabaseType | undefined,
drivers: readonly AgentDriverInstallState[],
+ driverProfile?: string,
): boolean {
if (!supportsDriverManagement(dbType)) return false;
- return drivers.find((driver) => driver.db_type === dbType)?.installed !== true;
+ const driverKey = dbType === "oracle" && driverProfile === "oracle-10g" ? "oracle-10g" : dbType;
+ return drivers.find((driver) => driver.db_type === driverKey)?.installed !== true;
}
diff --git a/packages/app-tests/agentDriverInstallHint.test.ts b/packages/app-tests/agentDriverInstallHint.test.ts
index 7a9788c915..30942fea0a 100644
--- a/packages/app-tests/agentDriverInstallHint.test.ts
+++ b/packages/app-tests/agentDriverInstallHint.test.ts
@@ -21,3 +21,29 @@ test("shows the agent driver install hint for Access when missing", () => {
test("does not show agent driver install hints for built-in database types", () => {
assert.equal(showAgentDriverInstallHint("mysql", [{ db_type: "informix", installed: false }]), false);
});
+
+test("uses the selected Oracle driver profile for install hints", () => {
+ assert.equal(
+ showAgentDriverInstallHint(
+ "oracle",
+ [
+ { db_type: "oracle", installed: false },
+ { db_type: "oracle-10g", installed: true },
+ ],
+ "oracle-10g",
+ ),
+ false,
+ );
+ assert.equal(
+ showAgentDriverInstallHint(
+ "oracle",
+ [
+ { db_type: "oracle", installed: true },
+ { db_type: "oracle-10g", installed: false },
+ ],
+ "oracle",
+ ),
+ false,
+ );
+ assert.equal(showAgentDriverInstallHint("oracle", [{ db_type: "oracle", installed: false }], "oracle"), true);
+});
diff --git a/packages/app-tests/webRuntimeCompatibility.test.ts b/packages/app-tests/webRuntimeCompatibility.test.ts
index a9acacd297..cd87bc4ed3 100644
--- a/packages/app-tests/webRuntimeCompatibility.test.ts
+++ b/packages/app-tests/webRuntimeCompatibility.test.ts
@@ -20,7 +20,7 @@ test("web runtime handles driver store open events", () => {
});
test("web runtime can show driver install hints", () => {
- assert.match(connectionDialogSource, /showAgentDriverInstallHint\(form\.value\.db_type, agentDrivers\.value\)/);
+ assert.match(connectionDialogSource, /showAgentDriverInstallHint\(form\.value\.db_type, agentDrivers\.value, selectedType\.value\)/);
assert.doesNotMatch(connectionDialogSource, /isDesktop &&\s+showAgentDriverInstallHint/);
});