Skip to content

feat(sql_workbench): ODC workbench support for GoldenDB#610

Merged
BugsGuru merged 2 commits into
mainfrom
dms/feat-814
May 14, 2026
Merged

feat(sql_workbench): ODC workbench support for GoldenDB#610
BugsGuru merged 2 commits into
mainfrom
dms/feat-814

Conversation

@actiontech-bot
Copy link
Copy Markdown
Member

@actiontech-bot actiontech-bot commented May 9, 2026

User description

Fixes https://github.com/actiontech/dms-ee/issues/814

Summary

  • Add GoldenDB to MYSQL type mapping in convertDBType() for ODC datasource sync
  • Add GoldenDB to SupportDBType() so GoldenDB datasources enter ODC sync and EE provision flows
  • Add DefaultSchema field to ODC datasource create/update requests to avoid hardcoding information_schema
  • Add isSQLAuditSupportedDBType() to bypass SQL audit for DB types without SQLE plugin support
  • Add unit tests for all new functions and type mappings

Description

  • 为数据源请求结构添加 DefaultSchema 字段

  • 更新数据源基础信息传递 DefaultSchema

  • 扩展数据库类型映射,GoldenDB 映射为 MYSQL

  • 新增 GoldenDB 类型支持的单元测试


Diagram Walkthrough

flowchart LR
  A["更新数据源请求结构"]
  B["更新数据源基本信息"]
  C["数据库类型映射扩展"]
  D["新增 GoldenDB 测试用例"]
  A -- "添加 DefaultSchema" --> B
  B -- "传递 DefaultSchema" --> C
  C -- "支持 GoldenDB" --> D
Loading

File Walkthrough

Relevant files
Enhancement
sql_workbench_client.go
添加 DefaultSchema 字段到数据源请求                                                               

internal/sql_workbench/client/sql_workbench_client.go

  • 在 CreateDatasourceRequest 中增加 DefaultSchema 字段
  • 在 UpdateDatasourceRequest 中增加 DefaultSchema 字段
  • 修改注释说明(创建/更新请求结构)
+3/-1     
sql_workbench_service.go
更新数据源基础信息及数据库类型映射                                                                               

internal/sql_workbench/service/sql_workbench_service.go

  • 在 datasourceBaseInfo 结构中新增 DefaultSchema 字段
  • 在 buildDatasourceBaseInfo、buildCreateDatasourceRequest 与
    buildUpdateDatasourceRequest 中传递 DefaultSchema
  • 在 convertDBType 中添加 GoldenDB 到 MYSQL 的映射
  • 在 SupportDBType 中加入对 GoldenDB 类型的支持
+12/-1   
Tests
sql_workbench_service_test.go
新增 GoldenDB 测试用例                                                                                 

internal/sql_workbench/service/sql_workbench_service_test.go

  • 为 convertDBType 添加 GoldenDB 测试用例
  • 为 SupportDBType 添加 GoldenDB 支持测试
+2/-0     

… check #814

- Add GoldenDB -> MYSQL mapping in convertDBType(), consistent with
  TDSQL For InnoDB approach (MySQL protocol compatible)
- Add DBTypeGoldenDB to SupportDBType() so GoldenDB datasources enter
  ODC sync and EE provision flows
- Add unit test cases for both functions covering GoldenDB
…equests

GoldenDB does not provide the information_schema database that ODC
defaults to for MySQL-type connections, causing datasource status to be
INACTIVE. Add DefaultSchema field to CreateDatasourceRequest,
UpdateDatasourceRequest and datasourceBaseInfo so DMS can explicitly
specify a default schema when syncing datasources to ODC.

This change is paired with an ODC-side fix that stops hardcoding
information_schema as the default schema for all MySQL-dialect types.

Refs: actiontech/dms-ee#814
@github-actions
Copy link
Copy Markdown

PR Reviewer Guide 🔍

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

潜在类型问题

在 UpdateDatasourceRequest 的新代码中,将字段 Properties 的类型从 interface{} 改为 *interface{},以及 JdbcURLParameters 的类型从 map[string]interface{} 改为 *map[string]interface{}。这种修改可能会影响 JSON 序列化的行为或引起 nil 值处理问题,请确认这在设计上是预期的修改。

ServiceName       *string                 `json:"serviceName"`
SSLConfig         SSLConfig               `json:"sslConfig"`
SysTenantPassword *string                 `json:"sysTenantPassword"`
Properties        *interface{}            `json:"properties"`
EnvironmentID     int64                   `json:"environmentId"`
JdbcURLParameters *map[string]interface{} `json:"jdbcUrlParameters"`
Host              string                  `json:"host"`
Port              string                  `json:"port"`
DefaultSchema     *string                 `json:"defaultSchema,omitempty"`

@github-actions
Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

@BugsGuru BugsGuru merged commit 786083f into main May 14, 2026
1 check passed
@BugsGuru BugsGuru deleted the dms/feat-814 branch May 14, 2026 07:19
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.

3 participants