Merge pull request #782 from sunny0826/feat/kwdb
feat: add KWDB support
This commit is contained in:
39 files changed
+344
-71
No files matched your search
@@ -281,6 +281,7 @@ const driverProfiles: Record<
|
||||
icon: "opengauss",
|
||||
},
|
||||
gaussdb: { type: "gaussdb", port: 5432, user: "gaussdb", label: "GaussDB", icon: "gaussdb" },
|
||||
kwdb: { type: "kwdb", port: 26257, user: "root", label: "KWDB", icon: "kwdb" },
|
||||
kingbase: { type: "kingbase", port: 54321, user: "system", label: "KingBase", icon: "kingbase" },
|
||||
highgo: { type: "highgo", port: 5866, user: "highgo", label: "瀚高 HighGo", icon: "highgo" },
|
||||
yashandb: { type: "yashandb", port: 1688, user: "sys", label: "崖山 YashanDB", icon: "yashandb" },
|
||||
@@ -532,6 +533,7 @@ const sshPathSegments = computed(() => {
|
||||
function defaultDatabaseForProfile() {
|
||||
if (form.value.db_type === "redshift") return "dev";
|
||||
if (form.value.db_type === "gaussdb") return "postgres";
|
||||
if (form.value.db_type === "kwdb") return "defaultdb";
|
||||
if (selectedType.value === "cockroachdb") return "defaultdb";
|
||||
if (form.value.db_type === "highgo") return "highgo";
|
||||
if (form.value.db_type === "yashandb") return "yasdb";
|
||||
@@ -580,6 +582,7 @@ const iconTypeMap: Record<string, string> = {
|
||||
gbase: "gbase",
|
||||
opengauss: "opengauss",
|
||||
gaussdb: "gaussdb",
|
||||
kwdb: "kwdb",
|
||||
kingbase: "kingbase",
|
||||
highgo: "highgo",
|
||||
yashandb: "yashandb",
|
||||
@@ -625,6 +628,7 @@ const dbOptions = [
|
||||
{ value: "mariadb", label: "MariaDB" },
|
||||
{ value: "dm", label: "DM (Dameng)" },
|
||||
{ value: "gaussdb", label: "GaussDB" },
|
||||
{ value: "kwdb", label: "KWDB" },
|
||||
{ value: "tidb", label: "TiDB" },
|
||||
{ value: "oceanbase", label: "OceanBase" },
|
||||
{ value: "goldendb", label: "GoldenDB" },
|
||||
@@ -710,6 +714,7 @@ const tlsCapableDatabaseTypes = new Set<DatabaseType>([
|
||||
"postgres",
|
||||
"redshift",
|
||||
"gaussdb",
|
||||
"kwdb",
|
||||
"opengauss",
|
||||
"redis",
|
||||
"clickhouse",
|
||||
@@ -742,7 +747,7 @@ const mysqlClientKeyPath = computed({
|
||||
form.value.url_params = setUrlParam(next, "ssl-key", value);
|
||||
},
|
||||
});
|
||||
const nativePostgresTlsDatabaseTypes = new Set<DatabaseType>(["postgres", "redshift", "gaussdb", "opengauss"]);
|
||||
const nativePostgresTlsDatabaseTypes = new Set<DatabaseType>(["postgres", "redshift", "gaussdb", "kwdb", "opengauss"]);
|
||||
const supportsPostgresTlsOptions = computed(() => nativePostgresTlsDatabaseTypes.has(form.value.db_type));
|
||||
const postgresTlsMode = computed({
|
||||
get: () => {
|
||||
|
||||
@@ -29,6 +29,7 @@ const assetIcons: Record<string, string> = {
|
||||
oceanbase: "oceanbase",
|
||||
opengauss: "opengauss",
|
||||
gaussdb: "gaussdb",
|
||||
kwdb: "kwdb",
|
||||
kingbase: "kingbase",
|
||||
highgo: "highgo.png",
|
||||
goldendb: "goldendb.png",
|
||||
|
||||
@@ -156,6 +156,7 @@ const activeSqlFormatDialect = computed<SqlFormatDialect>(() => {
|
||||
case "mysql":
|
||||
return "mysql";
|
||||
case "postgres":
|
||||
case "kwdb":
|
||||
return "postgres";
|
||||
case "sqlite":
|
||||
case "rqlite":
|
||||
@@ -168,7 +169,8 @@ const activeSqlFormatDialect = computed<SqlFormatDialect>(() => {
|
||||
});
|
||||
|
||||
const editorDialect = computed<"mysql" | "postgres" | "sqlserver">(() => {
|
||||
if (activeEffectiveDatabaseType.value === "postgres") return "postgres";
|
||||
if (activeEffectiveDatabaseType.value === "postgres" || activeEffectiveDatabaseType.value === "kwdb")
|
||||
return "postgres";
|
||||
if (activeEffectiveDatabaseType.value === "sqlserver") return "sqlserver";
|
||||
return "mysql";
|
||||
});
|
||||
|
||||
@@ -181,6 +181,7 @@ const sourceDialect = computed<"mysql" | "postgres" | "sqlserver">(() => {
|
||||
if (
|
||||
effectiveDatabaseType.value === "postgres" ||
|
||||
effectiveDatabaseType.value === "gaussdb" ||
|
||||
effectiveDatabaseType.value === "kwdb" ||
|
||||
effectiveDatabaseType.value === "opengauss"
|
||||
)
|
||||
return "postgres";
|
||||
@@ -192,10 +193,12 @@ const sourceFormatDialect = computed<SqlFormatDialect>(() => {
|
||||
case "mysql":
|
||||
case "postgres":
|
||||
case "sqlite":
|
||||
case "rqlite":
|
||||
case "sqlserver":
|
||||
return effectiveDatabaseType.value;
|
||||
case "rqlite":
|
||||
return "sqlite";
|
||||
case "gaussdb":
|
||||
case "kwdb":
|
||||
case "opengauss":
|
||||
return "postgres";
|
||||
default:
|
||||
|
||||
@@ -307,6 +307,7 @@ function isPostgresIdentityType(dbType: string | undefined): boolean {
|
||||
return (
|
||||
dbType === "postgres" ||
|
||||
dbType === "gaussdb" ||
|
||||
dbType === "kwdb" ||
|
||||
dbType === "opengauss" ||
|
||||
dbType === "highgo" ||
|
||||
dbType === "vastbase" ||
|
||||
|
||||
Reference in new issue
Block a user