From 2e4589d5d43c3f2b9308b7ad46d1a966b499a725 Mon Sep 17 00:00:00 2001 From: BugsGuru Date: Thu, 12 Feb 2026 15:07:34 +0800 Subject: [PATCH] feat: add support for GaussDB database type in CloudbeaverUsecase - Implemented handling for GaussDB database type in GenerateCloudbeaverConnectionParams. - Added a new method, fillGaussDBParams, to configure connection parameters specific to GaussDB. - Updated constant definitions to include DBTypeGaussDB for improved database type management. --- internal/dms/biz/cloudbeaver.go | 7 +++++++ internal/dms/pkg/constant/const.go | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/internal/dms/biz/cloudbeaver.go b/internal/dms/biz/cloudbeaver.go index 667d5439..b48df02f 100644 --- a/internal/dms/biz/cloudbeaver.go +++ b/internal/dms/biz/cloudbeaver.go @@ -1707,6 +1707,8 @@ func (cu *CloudbeaverUsecase) GenerateCloudbeaverConnectionParams(dbService *DBS err = cu.fillHive4Params(config) case constant.DBTypeDM: err = cu.fillDMParams(config) + case constant.DBTypeGaussDB: + err = cu.fillGaussDBParams(config) default: return nil, fmt.Errorf("temporarily unsupported instance types") @@ -1814,6 +1816,11 @@ func (cu *CloudbeaverUsecase) fillDMParams(config map[string]interface{}) error return nil } +func (cu *CloudbeaverUsecase) fillGaussDBParams(config map[string]interface{}) error { + config["driverId"] = "generic:gaussdb_jdbc" + return nil +} + func (cu *CloudbeaverUsecase) getGraphQLClientWithRootUser() (*cloudbeaver.Client, error) { adminUser := cu.cloudbeaverCfg.AdminUser diff --git a/internal/dms/pkg/constant/const.go b/internal/dms/pkg/constant/const.go index 8a468b02..97dea141 100644 --- a/internal/dms/pkg/constant/const.go +++ b/internal/dms/pkg/constant/const.go @@ -243,6 +243,9 @@ func ParseDBType(s string) (DBType, error) { return DBTypeHive, nil case "DM": return DBTypeDM, nil + case "GaussDB for MySQL": + return DBTypeGaussDB, nil + default: return "", fmt.Errorf("invalid db type: %s", s) } @@ -261,6 +264,7 @@ const ( DBTypeTBase DBType = "TBase" DBTypeHive DBType = "Hive" DBTypeDM DBType = "达梦(DM)" + DBTypeGaussDB DBType = "GaussDB / openGauss" ) var SupportedDataExportDBTypes = map[DBType]struct{}{