feat(uxdb): add UXDB database support
This commit is contained in:
65 files changed
+697
-96
No files matched your search
@@ -11,7 +11,7 @@ export interface BuildRenameObjectSqlOptions {
|
||||
newName: string;
|
||||
}
|
||||
|
||||
const postgresLikeRenameTypes = new Set<DatabaseType>(["postgres", "redshift", "gaussdb", "kwdb", "kingbase", "highgo", "vastbase"]);
|
||||
const postgresLikeRenameTypes = new Set<DatabaseType>(["postgres", "redshift", "gaussdb", "kwdb", "kingbase", "highgo", "uxdb", "vastbase"]);
|
||||
|
||||
const oracleLikeRenameTypes = new Set<DatabaseType>(["oracle", "dameng"]);
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ export type BuildRoutineRenameObjectSourceInput = BuildEditableObjectSourceSqlIn
|
||||
|
||||
export type ObjectSourceSaveExecutionMode = "single" | "script";
|
||||
|
||||
const postgresLikeRoutineRenameTypes = new Set<DatabaseType>(["postgres", "redshift", "gaussdb", "kwdb", "kingbase", "highgo", "vastbase"]);
|
||||
const postgresLikeViewTypes = new Set<DatabaseType>(["postgres", "redshift", "gaussdb", "kwdb", "opengauss", "questdb", "kingbase", "highgo", "vastbase"]);
|
||||
const postgresLikeRoutineRenameTypes = new Set<DatabaseType>(["postgres", "redshift", "gaussdb", "kwdb", "kingbase", "highgo", "uxdb", "vastbase"]);
|
||||
const postgresLikeViewTypes = new Set<DatabaseType>(["postgres", "redshift", "gaussdb", "kwdb", "opengauss", "questdb", "kingbase", "highgo", "uxdb", "vastbase"]);
|
||||
const mysqlLikeRoutineRenameTypes = new Set<DatabaseType>(["mysql", "goldendb"]);
|
||||
const oracleLikeRoutineRenameTypes = new Set<DatabaseType>(["oracle", "dameng"]);
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@ export function importDataTypeForDatabase(inferredType: ImportInferredType, data
|
||||
if (databaseType === "clickhouse") return "Int64";
|
||||
return "BIGINT";
|
||||
case "decimal":
|
||||
if (["postgres", "gaussdb", "opengauss", "redshift", "kingbase", "highgo", "kwdb", "vastbase"].includes(databaseType || "")) return "DOUBLE PRECISION";
|
||||
if (["postgres", "gaussdb", "opengauss", "redshift", "kingbase", "highgo", "uxdb", "kwdb", "vastbase"].includes(databaseType || "")) return "DOUBLE PRECISION";
|
||||
if (databaseType === "sqlite" || databaseType === "rqlite" || databaseType === "turso" || databaseType === "cloudflare-d1") return "REAL";
|
||||
if (databaseType === "oracle" || databaseType === "oceanbase-oracle" || databaseType === "dameng") return "BINARY_DOUBLE";
|
||||
if (databaseType === "clickhouse") return "Float64";
|
||||
@@ -254,7 +254,7 @@ export function importDataTypeForDatabase(inferredType: ImportInferredType, data
|
||||
if (databaseType === "clickhouse") return "DateTime64";
|
||||
return "TIMESTAMP";
|
||||
case "json":
|
||||
if (["postgres", "gaussdb", "opengauss", "kingbase", "highgo", "kwdb", "vastbase"].includes(databaseType || "")) return "JSONB";
|
||||
if (["postgres", "gaussdb", "opengauss", "kingbase", "highgo", "uxdb", "kwdb", "vastbase"].includes(databaseType || "")) return "JSONB";
|
||||
if (databaseType === "mysql" || databaseType === "databend") return "JSON";
|
||||
return importDataTypeForDatabase("text", databaseType);
|
||||
case "text":
|
||||
|
||||
@@ -313,6 +313,7 @@ const capabilityByType: Partial<Record<DatabaseType, TableStructureCapabilities>
|
||||
redshift: redshiftCapabilities,
|
||||
vertica: redshiftCapabilities,
|
||||
highgo: postgresCapabilities,
|
||||
uxdb: postgresCapabilities,
|
||||
vastbase: postgresCapabilities,
|
||||
kingbase: postgresCapabilities,
|
||||
firebird: firebirdCapabilities,
|
||||
|
||||
@@ -288,6 +288,7 @@ const DATA_TYPE_OPTION_ALIASES: Partial<Record<DatabaseType, string>> = {
|
||||
questdb: "questdb",
|
||||
redshift: "postgres",
|
||||
highgo: "postgres",
|
||||
uxdb: "postgres",
|
||||
vastbase: "postgres",
|
||||
kingbase: "postgres",
|
||||
dameng: "oracle",
|
||||
@@ -466,7 +467,7 @@ export function parseExtraToColumnExtra(extra: string | null | undefined, databa
|
||||
if (lower.includes("on update current_timestamp")) {
|
||||
result.onUpdateCurrentTimestamp = true;
|
||||
}
|
||||
} else if (databaseType === "postgres" || databaseType === "gaussdb" || databaseType === "kwdb" || databaseType === "opengauss" || databaseType === "questdb" || databaseType === "highgo" || databaseType === "vastbase" || databaseType === "kingbase") {
|
||||
} else if (databaseType === "postgres" || databaseType === "gaussdb" || databaseType === "kwdb" || databaseType === "opengauss" || databaseType === "questdb" || databaseType === "highgo" || databaseType === "uxdb" || databaseType === "vastbase" || databaseType === "kingbase") {
|
||||
const identityMatch = lower.match(/generated\s+(by\s+default|always)\s+as\s+identity/i);
|
||||
if (identityMatch) {
|
||||
const sequenceMatch = lower.match(/start\s+with\s*(-?\d+)\s+increment\s+by\s*(-?\d+)/i);
|
||||
@@ -1016,6 +1017,7 @@ function isTemporalPrecisionType(dbType: DatabaseType | undefined, baseType: str
|
||||
case "kwdb":
|
||||
case "opengauss":
|
||||
case "highgo":
|
||||
case "uxdb":
|
||||
case "vastbase":
|
||||
case "kingbase":
|
||||
case "redshift":
|
||||
@@ -1109,7 +1111,7 @@ export function isDataTypeLengthDisabled(_dbType: DatabaseType | undefined, base
|
||||
return key !== "geohash" && key !== "decimal";
|
||||
} else if (_dbType === "manticoresearch") {
|
||||
return key !== "bit" && key !== "float_vector";
|
||||
} else if (_dbType === "postgres" || _dbType === "gaussdb" || _dbType === "kwdb" || _dbType === "opengauss" || _dbType === "highgo" || _dbType === "vastbase" || _dbType === "kingbase") {
|
||||
} else if (_dbType === "postgres" || _dbType === "gaussdb" || _dbType === "kwdb" || _dbType === "opengauss" || _dbType === "highgo" || _dbType === "uxdb" || _dbType === "vastbase" || _dbType === "kingbase") {
|
||||
return POSTGRES_TYPE_LENGTH_DISABLES.includes(key);
|
||||
} else if (isOracleLikeStructureType(_dbType)) {
|
||||
// Dameng/Oracle integer aliases have fixed precision; MySQL-style display widths generate invalid DDL.
|
||||
|
||||
Reference in new issue
Block a user