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: auto-migrate GaussDB/openGauss connections from postgres to gaussdb driver

t8y21e7192ad1ed1
diff --git a/src/stores/connectionStore.ts b/src/stores/connectionStore.ts
index 5287fca339..08812086e1 100644
--- a/src/stores/connectionStore.ts
+++ b/src/stores/connectionStore.ts
@@ -132,10 +132,18 @@ export const useConnectionStore = defineStore("connection", () => {
dameng: "DM (Dameng)",
gaussdb: "GaussDB",
};
+
+ const profile = config.driver_profile || config.db_type;
+ let dbType = config.db_type;
+ if ((profile === "gaussdb" || profile === "opengauss") && dbType === "postgres") {
+ dbType = "gaussdb" as ConnectionConfig["db_type"];
+ }
+
return {
...config,
- driver_profile: config.driver_profile || config.db_type,
- driver_label: config.driver_label || labelMap[config.driver_profile || config.db_type] || config.db_type,
+ db_type: dbType,
+ driver_profile: profile,
+ driver_label: config.driver_label || labelMap[profile] || config.db_type,
url_params: config.url_params || "",
};
}