Skip to content

Feat cb dameng#568

Merged
LordofAvernus merged 2 commits intomainfrom
feat-cb-dameng
Feb 5, 2026
Merged

Feat cb dameng#568
LordofAvernus merged 2 commits intomainfrom
feat-cb-dameng

Conversation

@BugsGuru
Copy link
Collaborator

@BugsGuru BugsGuru commented Feb 5, 2026

User description

关联的 issue

dm: https://github.com/actiontech/sqle-ee/issues/2637
hive: https://github.com/actiontech/sqle-ee/issues/2581

描述你的变更

  • dms上支持hive和达梦数据源

确认项(pr提交后操作)

Tip

请在指定复审人之前,确认并完成以下事项,完成后✅


  • 我已完成自测
  • 我已记录完整日志方便进行诊断
  • 我已在关联的issue里补充了实现方案
  • 我已在关联的issue里补充了测试影响面
  • 我已确认了变更的兼容性,如果不兼容则在issue里标记 not_compatible
  • 我已确认了是否要更新文档,如果要更新则在issue里标记 need_update_doc

assgin in @LordofAvernus


Description

  • 为Cloudbeaver连接参数新增Hive支持

  • 新增达梦数据库专用方法fillDMParams

  • 更新常量定义支持Hive及达梦


Diagram Walkthrough

flowchart LR
  A["CloudbeaverUsecase 参数生成"] --> B["新增Hive支持:fillHive4Params"]
  A --> C["新增达梦支持:fillDMParams"]
  D["常量定义更新"] --> E["新增DBTypeHive"]
  D --> F["新增DBTypeDM"]
Loading

File Walkthrough

Relevant files
Enhancement
cloudbeaver.go
在CloudbeaverUsecase中添加Hive和达梦支持                                                   

internal/dms/biz/cloudbeaver.go

  • 添加处理Hive连接参数分支
  • 添加达梦连接参数专用函数
  • 更新switch分支新增Hive和达梦
+15/-0   
const.go
更新常量定义与解析支持新数据库类型                                                                               

internal/dms/pkg/constant/const.go

  • 新增Hive数据库类型解析
  • 新增达梦数据库常量定义
  • 更新DB类型解析逻辑
+6/-0     

LordofAvernus and others added 2 commits February 5, 2026 17:05
- 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.
@github-actions
Copy link

github-actions bot commented Feb 5, 2026

PR Reviewer Guide 🔍

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

参数处理一致性

请确认新增的填充函数(fillHive4Params和fillDMParams)中,设置的driverId值是否满足各数据库驱动的要求,确保传递参数与后续使用的一致性。

case constant.DBTypeHive:
	err = cu.fillHive4Params(config)
case constant.DBTypeDM:
	err = cu.fillDMParams(config)
常量命名一致性

请检查在ParseDBType中对于"DM"的处理与常量DBTypeDM(值为"达梦(DM)")是否一致,确保前后端匹配不会产生意外行为。

	DBTypeHive           DBType = "Hive"
	DBTypeDM             DBType = "达梦(DM)"
)

@github-actions
Copy link

github-actions bot commented Feb 5, 2026

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
添加 nil 检查

建议在这两个函数的开始处增加对 config 是否为 nil 的判断,避免在 config 为 nil 时进行赋值操作引发
panic。这样可以提高代码的鲁棒性,并预防空指针异常。

internal/dms/biz/cloudbeaver.go [1807-1815]

 func (cu *CloudbeaverUsecase) fillHive4Params(config map[string]interface{}) error {
+	if config == nil {
+		return fmt.Errorf("config is nil")
+	}
 	config["driverId"] = "hive:apache_hive4"
 	return nil
 }
 
 func (cu *CloudbeaverUsecase) fillDMParams(config map[string]interface{}) error {
+	if config == nil {
+		return fmt.Errorf("config is nil")
+	}
 	config["driverId"] = "generic:dameng_jdbc"
 	return nil
 }
Suggestion importance[1-10]: 7

__

Why: The suggestion adds a nil check for the config parameter in both fillHive4Params and fillDMParams, which improves robustness by preventing potential panics. However, it's a minor enhancement addressing error handling, so the impact is moderate.

Medium

@LordofAvernus LordofAvernus merged commit 08043c5 into main Feb 5, 2026
1 check passed
@BugsGuru BugsGuru deleted the feat-cb-dameng branch February 5, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants