Skip to content

Commit f071234

Browse files
Merge pull request #572 from actiontech/feat-data-export-ce
Feat data export ce
2 parents ff67c2c + da5e24b commit f071234

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

internal/dms/biz/db_service.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,7 @@ func filterExportSupportedDb(dbServices []*DBService, opPermissionType dmsCommon
484484
}
485485
ret := make([]*DBService, 0)
486486
for _, item := range dbServices {
487-
_, ok := pkgConst.SupportedDataExportDBTypes[pkgConst.DBType(item.DBType)]
488-
if ok {
487+
if pkgConst.CheckDBTypeIfDataExportSupported(item.DBType) {
489488
ret = append(ret, item)
490489
}
491490
}

internal/dms/pkg/constant/const.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,23 @@ const (
267267
DBTypeGaussDB DBType = "GaussDB / openGauss"
268268
)
269269

270-
var SupportedDataExportDBTypes = map[DBType]struct{}{
270+
var supportedDataExportDBTypes = map[DBType]struct{}{
271271
DBTypeMySQL: {},
272272
DBTypePostgreSQL: {},
273273
DBTypeOracle: {},
274274
DBTypeSQLServer: {},
275275
DBTypeOceanBaseMySQL: {},
276+
DBTypeHive: {},
277+
DBTypeDM: {},
278+
}
279+
280+
func CheckDBTypeIfDataExportSupported(dbtype string) bool {
281+
dbType, err := ParseDBType(dbtype)
282+
if err != nil {
283+
return false
284+
}
285+
_, ok := supportedDataExportDBTypes[dbType]
286+
return ok
276287
}
277288

278289
type FilterCondition struct {

0 commit comments

Comments
 (0)