mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-06-30 18:41:26 +08:00
@@ -207,7 +207,7 @@ func directImportPaginationPK(sourceType string, sourceCols []connection.ColumnD
|
||||
|
||||
func supportsDirectImportPagination(dbType string) bool {
|
||||
switch normalizeMigrationDBType(dbType) {
|
||||
case "mysql", "mariadb", "postgres", "kingbase", "highgo", "vastbase", "opengauss", "sqlserver", "sqlite", "duckdb", "clickhouse", "tdengine", "starrocks", "diros":
|
||||
case "mysql", "mariadb", "postgres", "kingbase", "highgo", "vastbase", "opengauss", "gaussdb", "sqlserver", "sqlite", "duckdb", "clickhouse", "tdengine", "starrocks", "diros":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
|
||||
@@ -119,7 +119,7 @@ func isMySQLLikeType(dbType string) bool {
|
||||
|
||||
func classifyMigrationDataModel(dbType string) MigrationDataModel {
|
||||
switch normalizeMigrationDBType(dbType) {
|
||||
case "mysql", "mariadb", "oceanbase", "postgres", "kingbase", "highgo", "vastbase", "opengauss", "oracle", "sqlserver", "dameng", "sqlite", "duckdb":
|
||||
case "mysql", "mariadb", "oceanbase", "postgres", "kingbase", "highgo", "vastbase", "opengauss", "gaussdb", "oracle", "sqlserver", "dameng", "sqlite", "duckdb":
|
||||
return MigrationDataModelRelational
|
||||
case "mongodb":
|
||||
return MigrationDataModelDocument
|
||||
|
||||
@@ -16,6 +16,8 @@ func normalizeMigrationDBType(dbType string) string {
|
||||
return "kingbase"
|
||||
case "opengauss", "open_gauss", "open-gauss":
|
||||
return "opengauss"
|
||||
case "gaussdb", "gauss_db", "gauss-db":
|
||||
return "gaussdb"
|
||||
case "dm", "dm8":
|
||||
return "dameng"
|
||||
case "sqlite3":
|
||||
@@ -37,6 +39,8 @@ func resolveMigrationDBType(config connection.ConnectionConfig) string {
|
||||
return "postgres"
|
||||
case "opengauss", "open_gauss", "open-gauss":
|
||||
return "opengauss"
|
||||
case "gaussdb", "gauss_db", "gauss-db":
|
||||
return "gaussdb"
|
||||
case "dm", "dameng", "dm8":
|
||||
return "dameng"
|
||||
case "sqlite3", "sqlite":
|
||||
@@ -64,6 +68,8 @@ func resolveMigrationDBType(config connection.ConnectionConfig) string {
|
||||
switch {
|
||||
case strings.Contains(driver, "opengauss"), strings.Contains(driver, "open_gauss"), strings.Contains(driver, "open-gauss"):
|
||||
return "opengauss"
|
||||
case strings.Contains(driver, "gaussdb"), strings.Contains(driver, "gauss_db"), strings.Contains(driver, "gauss-db"):
|
||||
return "gaussdb"
|
||||
case strings.Contains(driver, "postgres"):
|
||||
return "postgres"
|
||||
case strings.Contains(driver, "kingbase"):
|
||||
|
||||
@@ -575,7 +575,7 @@ func intFromAny(v interface{}) int {
|
||||
|
||||
func isPGLikeSource(dbType string) bool {
|
||||
switch normalizeMigrationDBType(dbType) {
|
||||
case "postgres", "kingbase", "highgo", "vastbase", "opengauss", "duckdb":
|
||||
case "postgres", "kingbase", "highgo", "vastbase", "opengauss", "gaussdb", "duckdb":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
@@ -584,7 +584,7 @@ func isPGLikeSource(dbType string) bool {
|
||||
|
||||
func isPGLikeSameFamilyDDLType(dbType string) bool {
|
||||
switch normalizeMigrationDBType(dbType) {
|
||||
case "postgres", "kingbase", "highgo", "vastbase", "opengauss":
|
||||
case "postgres", "kingbase", "highgo", "vastbase", "opengauss", "gaussdb":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
@@ -1360,7 +1360,7 @@ func mapPGLikeDefaultToMySQL(col connection.ColumnDefinition, targetType string)
|
||||
|
||||
func isPGLikeTarget(dbType string) bool {
|
||||
switch normalizeMigrationDBType(dbType) {
|
||||
case "postgres", "kingbase", "highgo", "vastbase", "opengauss", "duckdb":
|
||||
case "postgres", "kingbase", "highgo", "vastbase", "opengauss", "gaussdb", "duckdb":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
|
||||
@@ -505,7 +505,7 @@ func (s *SyncEngine) runSourceQuerySync(config SyncConfig) SyncResult {
|
||||
deletes := make([]map[string]interface{}, 0)
|
||||
applyTableName := ctx.TargetTable
|
||||
switch ctx.TargetType {
|
||||
case "postgres", "kingbase", "highgo", "vastbase", "opengauss", "sqlserver":
|
||||
case "postgres", "kingbase", "highgo", "vastbase", "opengauss", "gaussdb", "sqlserver":
|
||||
applyTableName = ctx.TargetQueryTable
|
||||
}
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ func normalizeSchemaAndTable(dbType string, dbName string, tableName string) (st
|
||||
}
|
||||
|
||||
switch normalizedType {
|
||||
case "postgres", "kingbase", "highgo", "vastbase", "opengauss":
|
||||
case "postgres", "kingbase", "highgo", "vastbase", "opengauss", "gaussdb":
|
||||
return "public", rawTable
|
||||
case "duckdb":
|
||||
return "main", rawTable
|
||||
@@ -186,7 +186,7 @@ func qualifiedNameForQuery(dbType string, schema string, table string, original
|
||||
}
|
||||
|
||||
switch normalizeMigrationDBType(dbType) {
|
||||
case "postgres", "kingbase", "highgo", "vastbase", "opengauss":
|
||||
case "postgres", "kingbase", "highgo", "vastbase", "opengauss", "gaussdb":
|
||||
s := strings.TrimSpace(schema)
|
||||
if s == "" {
|
||||
s = "public"
|
||||
|
||||
@@ -214,7 +214,7 @@ func (s *SyncEngine) RunSync(config SyncConfig) SyncResult {
|
||||
sourceQueryTable, targetQueryTable := plan.SourceQueryTable, plan.TargetQueryTable
|
||||
applyTableName := targetTable
|
||||
switch targetType {
|
||||
case "postgres", "kingbase", "highgo", "vastbase", "opengauss", "sqlserver":
|
||||
case "postgres", "kingbase", "highgo", "vastbase", "opengauss", "gaussdb", "sqlserver":
|
||||
applyTableName = targetQueryTable
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user