From e9e0e45f6b06f4acd4f0bdae20d5c091075096d2 Mon Sep 17 00:00:00 2001 From: yangzhongjiao Date: Thu, 13 Nov 2025 08:36:41 +0000 Subject: [PATCH 1/2] feat: add support for Hive database in Cloudbeaver connection parameters --- internal/dms/biz/cloudbeaver.go | 7 +++++++ internal/dms/pkg/constant/const.go | 3 +++ 2 files changed, 10 insertions(+) diff --git a/internal/dms/biz/cloudbeaver.go b/internal/dms/biz/cloudbeaver.go index 8d6b4ccb..e73f9d70 100644 --- a/internal/dms/biz/cloudbeaver.go +++ b/internal/dms/biz/cloudbeaver.go @@ -1703,6 +1703,8 @@ func (cu *CloudbeaverUsecase) GenerateCloudbeaverConnectionParams(dbService *DBS err = cu.fillOceanBaseParams(dbService, config) case constant.DBTypeGoldenDB: err = cu.fillGoldenDBParams(config) + case constant.DBTypeHive: + err = cu.fillHive4Params(config) default: return nil, fmt.Errorf("temporarily unsupported instance types") } @@ -1799,6 +1801,11 @@ func (cu *CloudbeaverUsecase) fillGoldenDBParams(config map[string]interface{}) return nil } +func (cu *CloudbeaverUsecase) fillHive4Params(config map[string]interface{}) error { + config["driverId"] = "hive:apache_hive4" + 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 cb682c61..5477b219 100644 --- a/internal/dms/pkg/constant/const.go +++ b/internal/dms/pkg/constant/const.go @@ -239,6 +239,8 @@ func ParseDBType(s string) (DBType, error) { return DBTypeGoldenDB, nil case "TBase": return DBTypeTBase, nil + case "Hive": + return DBTypeHive, nil default: return "", fmt.Errorf("invalid db type: %s", s) } @@ -255,6 +257,7 @@ const ( DBTypeTDSQLForInnoDB DBType = "TDSQL For InnoDB" DBTypeGoldenDB DBType = "GoldenDB" DBTypeTBase DBType = "TBase" + DBTypeHive DBType = "Hive" ) var SupportedDataExportDBTypes = map[DBType]struct{}{ From fb07537c4790ddb1ad30f847ab2d4ec00d93a988 Mon Sep 17 00:00:00 2001 From: BugsGuru Date: Thu, 5 Feb 2026 16:58:35 +0800 Subject: [PATCH 2/2] feat: add support for DM database type in CloudbeaverUsecase - Introduced handling for the DM database type in GenerateCloudbeaverConnectionParams. - Added a new method, fillDMParams, to configure connection parameters specific to DM. - Updated constant definitions to include DBTypeDM for better database type management. --- internal/dms/biz/cloudbeaver.go | 8 ++++++++ internal/dms/pkg/constant/const.go | 3 +++ 2 files changed, 11 insertions(+) diff --git a/internal/dms/biz/cloudbeaver.go b/internal/dms/biz/cloudbeaver.go index e73f9d70..667d5439 100644 --- a/internal/dms/biz/cloudbeaver.go +++ b/internal/dms/biz/cloudbeaver.go @@ -1705,6 +1705,9 @@ func (cu *CloudbeaverUsecase) GenerateCloudbeaverConnectionParams(dbService *DBS err = cu.fillGoldenDBParams(config) case constant.DBTypeHive: err = cu.fillHive4Params(config) + case constant.DBTypeDM: + err = cu.fillDMParams(config) + default: return nil, fmt.Errorf("temporarily unsupported instance types") } @@ -1806,6 +1809,11 @@ func (cu *CloudbeaverUsecase) fillHive4Params(config map[string]interface{}) err return nil } +func (cu *CloudbeaverUsecase) fillDMParams(config map[string]interface{}) error { + config["driverId"] = "generic:dameng_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 5477b219..8a468b02 100644 --- a/internal/dms/pkg/constant/const.go +++ b/internal/dms/pkg/constant/const.go @@ -241,6 +241,8 @@ func ParseDBType(s string) (DBType, error) { return DBTypeTBase, nil case "Hive": return DBTypeHive, nil + case "DM": + return DBTypeDM, nil default: return "", fmt.Errorf("invalid db type: %s", s) } @@ -258,6 +260,7 @@ const ( DBTypeGoldenDB DBType = "GoldenDB" DBTypeTBase DBType = "TBase" DBTypeHive DBType = "Hive" + DBTypeDM DBType = "达梦(DM)" ) var SupportedDataExportDBTypes = map[DBType]struct{}{