feat(uxdb): add UXDB database support

This commit is contained in:
t8y2 committed 2026-07-24 21:15:06 +08:00
1 parent 3035800658
commit 7ee335e38a
65 files changed
+697 -96

No files matched your search

@@ -10,6 +10,7 @@ const DRIVER_STARTUP_FLOOR_TYPES = new Set<DatabaseType>([
"dameng",
"kingbase",
"highgo",
"uxdb",
"vastbase",
"goldendb",
"yashandb",
@@ -10,6 +10,7 @@ export const SCHEMA_AWARE_TYPES = new Set<DatabaseType>([
"kwdb",
"kingbase",
"highgo",
"uxdb",
"vastbase",
"yashandb",
"databricks",
@@ -57,6 +58,7 @@ export const TREE_SCHEMA_TYPES = new Set<DatabaseType>([
"kwdb",
"kingbase",
"highgo",
"uxdb",
"vastbase",
"yashandb",
"databricks",
@@ -41,6 +41,7 @@ export const DATABASE_NAMESPACE_CREATION_MATRIX = {
gaussdb: { connection: "database", database: "schema" },
kingbase: { connection: "database", database: "schema" },
highgo: { connection: "database", database: "schema" },
uxdb: { database: "schema" },
vastbase: { connection: "database", database: "schema" },
goldendb: { connection: "database" },
kwdb: { connection: "database", database: "schema" },
@@ -26,6 +26,7 @@ const DATABASE_TYPE_OBJECTS = new Map<DatabaseType, SidebarObjectKind[]>([
// postgres like
["kingbase", POSTGRES_LIKE_OBJECTS],
["highgo", POSTGRES_LIKE_OBJECTS],
["uxdb", POSTGRES_LIKE_OBJECTS],
["vastbase", POSTGRES_LIKE_OBJECTS],
["redshift", POSTGRES_LIKE_OBJECTS],
// oracle
@@ -13,7 +13,7 @@ type PropertyEditConnection = Pick<ConnectionConfig, "db_type" | "driver_profile
type DatabaseNode = Pick<{ type: TreeNodeType; database?: string | null }, "type" | "database">;
type SchemaNode = Pick<{ type: TreeNodeType; database?: string | null; schema?: string | null }, "type" | "database" | "schema">;
const POSTGRES_COMMENT_TYPES = new Set<DatabaseType>(["postgres", "gaussdb", "kwdb", "kingbase", "highgo", "vastbase", "opengauss", "yashandb"]);
const POSTGRES_COMMENT_TYPES = new Set<DatabaseType>(["postgres", "gaussdb", "kwdb", "kingbase", "highgo", "uxdb", "vastbase", "opengauss", "yashandb"]);
export const DATABASE_PROPERTY_EDITING_MATRIX = {
mysql: { database: ["charsetCollation"] },
@@ -42,6 +42,7 @@ export const DATABASE_PROPERTY_EDITING_MATRIX = {
gaussdb: { database: ["databaseComment"], schema: ["schemaComment"] },
kingbase: { database: ["databaseComment"], schema: ["schemaComment"] },
highgo: { database: ["databaseComment"], schema: ["schemaComment"] },
uxdb: { database: ["databaseComment"], schema: ["schemaComment"] },
vastbase: { database: ["databaseComment"], schema: ["schemaComment"] },
goldendb: { database: ["charsetCollation"] },
kwdb: { database: ["databaseComment"], schema: ["schemaComment"] },
@@ -64,6 +64,7 @@ const NAVICAT_STYLE_TABLE_DATA_TYPES = new Set<DatabaseType>([
"kwdb",
"kingbase",
"highgo",
"uxdb",
"vastbase",
"goldendb",
"yashandb",
+3 -3
View File
@@ -87,8 +87,8 @@ export function buildTruncateTableSql(options: TableAdminSqlOptions): Promise<st
return api.buildTruncateTableSql(options);
}
const DROP_TABLE_CASCADE_DATABASE_TYPES: readonly DatabaseType[] = ["postgres", "redshift", "gaussdb", "kwdb", "kingbase", "highgo", "vastbase", "opengauss"];
const TRUNCATE_TABLE_CASCADE_DATABASE_TYPES: readonly DatabaseType[] = ["postgres", "gaussdb", "kwdb", "kingbase", "highgo", "vastbase", "opengauss"];
const DROP_TABLE_CASCADE_DATABASE_TYPES: readonly DatabaseType[] = ["postgres", "redshift", "gaussdb", "kwdb", "kingbase", "highgo", "uxdb", "vastbase", "opengauss"];
const TRUNCATE_TABLE_CASCADE_DATABASE_TYPES: readonly DatabaseType[] = ["postgres", "gaussdb", "kwdb", "kingbase", "highgo", "uxdb", "vastbase", "opengauss"];
export function supportsDropTableCascade(databaseType?: DatabaseType): boolean {
return !!databaseType && DROP_TABLE_CASCADE_DATABASE_TYPES.includes(databaseType);
@@ -111,7 +111,7 @@ export function buildDropSchemaSql(options: SchemaNameSqlOptions): Promise<strin
}
export function supportsSchemaComment(databaseType?: DatabaseType): boolean {
return ["postgres", "gaussdb", "kwdb", "kingbase", "highgo", "vastbase", "opengauss", "yashandb"].includes(databaseType || "");
return ["postgres", "gaussdb", "kwdb", "kingbase", "highgo", "uxdb", "vastbase", "opengauss", "yashandb"].includes(databaseType || "");
}
export function buildUpdateDatabasePropertiesSql(options: DatabasePropertyEditSqlOptions): Promise<string> {
@@ -42,6 +42,7 @@ const SCHEMA_FIRST_QUALIFIER_TYPES = new Set<DatabaseType>([
"opengauss",
"kingbase",
"highgo",
"uxdb",
"vastbase",
"yashandb",
"oracle",
@@ -14,6 +14,7 @@ const SYSTEM_DATABASE_RULES: Partial<Record<DatabaseType, ReadonlySet<string>>>
questdb: new Set(["template0", "template1"]),
kingbase: new Set(["template0", "template1"]),
highgo: new Set(["template0", "template1"]),
uxdb: new Set(["template0", "template1"]),
vastbase: new Set(["template0", "template1"]),
redshift: new Set(["template0", "template1"]),
clickhouse: new Set(["information_schema", "system"]),
@@ -6,7 +6,7 @@ export type CodeMirrorSqlDialectName = "mysql" | "postgres" | "sqlserver";
type CodeMirrorSqlLanguageModule = Pick<typeof import("@codemirror/lang-sql"), "Cassandra" | "MSSQL" | "MySQL" | "PLSQL" | "PostgreSQL" | "SQLite" | "SQLDialect" | "StandardSQL">;
const MYSQL_CODEMIRROR_DATABASE_TYPES = new Set<DatabaseType>(["mysql", "doris", "starrocks", "manticoresearch", "goldendb", "gbase"]);
const POSTGRES_CODEMIRROR_DATABASE_TYPES = new Set<DatabaseType>(["postgres", "redshift", "gaussdb", "kwdb", "kingbase", "highgo", "vastbase", "opengauss", "questdb"]);
const POSTGRES_CODEMIRROR_DATABASE_TYPES = new Set<DatabaseType>(["postgres", "redshift", "gaussdb", "kwdb", "kingbase", "highgo", "uxdb", "vastbase", "opengauss", "questdb"]);
const ORACLE_CODEMIRROR_DATABASE_TYPES = new Set<DatabaseType>(["oracle", "dameng", "yashandb", "oscar", "oceanbase-oracle"]);
const SQLITE_CODEMIRROR_DATABASE_TYPES = new Set<DatabaseType>(["sqlite", "rqlite", "turso", "cloudflare-d1"]);
@@ -150,6 +150,7 @@ export function sqlSemanticDialectFor(options: { databaseType?: DatabaseType; di
case "opengauss":
case "gaussdb":
case "highgo":
case "uxdb":
return SQL_SEMANTIC_DIALECTS.postgres;
case "mysql":
case "doris":
+1 -1
View File
@@ -48,7 +48,7 @@ export interface EditableQuerySource {
alias?: string;
}
const POSTGRES_FOLDED_IDENTIFIER_TYPES = new Set(["postgres", "redshift", "gaussdb", "highgo", "vastbase", "kwdb", "opengauss", "questdb"]);
const POSTGRES_FOLDED_IDENTIFIER_TYPES = new Set(["postgres", "redshift", "gaussdb", "highgo", "uxdb", "vastbase", "kwdb", "opengauss", "questdb"]);
const ORACLE_FOLDED_IDENTIFIER_TYPES = new Set(["oracle", "dameng", "oceanbase-oracle"]);
/**
+1
View File
@@ -24,6 +24,7 @@ export function sqlFormatDialectForDbType(dbType: string | null | undefined): Sq
case "questdb":
case "kingbase":
case "highgo":
case "uxdb":
case "vastbase":
case "redshift":
return "postgres";
@@ -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"]);
+2 -2
View File
@@ -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.