From 1e7192ad1ed17a2b25b96c35c0352b0c840284f8 Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Thu, 7 May 2026 11:45:19 +0800 Subject: [PATCH] fix: auto-migrate GaussDB/openGauss connections from postgres to gaussdb driver --- src/stores/connectionStore.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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 || "", }; }