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

+2 -2
View File
@@ -90,7 +90,7 @@
### 70+ Databases, One Tool ### 70+ Databases, One Tool
MySQL, PostgreSQL, SQLite, Cloudflare D1, Redis, MongoDB, DuckDB, ClickHouse, SQL Server, Oracle, Elasticsearch, Qdrant, Milvus, Weaviate, MariaDB, TiDB, OceanBase, openGauss, GaussDB, KWDB, KingBase, Vastbase, GoldenDB, Doris, SelectDB, StarRocks, Manticore Search, Redshift, DM, TDengine, XuguDB, CockroachDB, Access, HighGo, and more. Agent/JDBC-oriented profiles extend DBX to H2, Snowflake, Trino, PrestoSQL, Hive, DB2, Informix, Neo4j, Cassandra, BigQuery, Kylin, SunDB, JDBCX, and custom JDBC connections. New native and agent-driven drivers also cover Databricks, SAP HANA, Teradata, Vertica, Firebird, Exasol, YashanDB, GBase 8a/8s, Databend, RQLite, Turso, InfluxDB, QuestDB, IoTDB, etcd, ZooKeeper, Nacos, IRIS, and more. Message queue admin is also available for Pulsar, Kafka, and RocketMQ. All in a single ~20 MB app. No bundled Chromium. MySQL, PostgreSQL, SQLite, Cloudflare D1, Redis, MongoDB, DuckDB, ClickHouse, SQL Server, Oracle, Elasticsearch, Qdrant, Milvus, Weaviate, MariaDB, TiDB, OceanBase, openGauss, GaussDB, KWDB, KingBase, Vastbase, GoldenDB, Doris, SelectDB, StarRocks, Manticore Search, Redshift, DM, TDengine, XuguDB, CockroachDB, Access, HighGo, UXDB, and more. Agent/JDBC-oriented profiles extend DBX to H2, Snowflake, Trino, PrestoSQL, Hive, DB2, Informix, Neo4j, Cassandra, BigQuery, Kylin, SunDB, JDBCX, and custom JDBC connections. New native and agent-driven drivers also cover Databricks, SAP HANA, Teradata, Vertica, Firebird, Exasol, YashanDB, GBase 8a/8s, Databend, RQLite, Turso, InfluxDB, QuestDB, IoTDB, etcd, ZooKeeper, Nacos, IRIS, and more. Message queue admin is also available for Pulsar, Kafka, and RocketMQ. All in a single ~20 MB app. No bundled Chromium.
### Query Editor ### Query Editor
@@ -428,7 +428,7 @@ DBX is 20 MB with no runtime dependencies for its native database features (no s
<details> <details>
<summary><strong>What databases are supported?</strong></summary> <summary><strong>What databases are supported?</strong></summary>
MySQL, PostgreSQL, SQLite, Cloudflare D1, Redis, MongoDB, DuckDB, ClickHouse, SQL Server, Oracle, Elasticsearch, Qdrant, Milvus, Weaviate, MariaDB, TiDB, OceanBase, openGauss, GaussDB, KWDB, KingBase, Vastbase, GoldenDB, Doris, SelectDB, StarRocks, Manticore Search, Redshift, DM, TDengine, XuguDB, CockroachDB, Access, HighGo, and more. Agent/JDBC-oriented profiles extend support to H2, Snowflake, Trino, PrestoSQL, Hive, DB2, Informix, Neo4j, Cassandra, BigQuery, Kylin, SunDB, JDBCX, Databricks, SAP HANA, Teradata, Vertica, Firebird, Exasol, YashanDB, GBase 8a/8s, Databend, RQLite, Turso, InfluxDB, QuestDB, IoTDB, etcd, ZooKeeper, Nacos, IRIS, and custom JDBC connections. Message queue admin (Pulsar, Kafka, RocketMQ) is also supported. MySQL, PostgreSQL, SQLite, Cloudflare D1, Redis, MongoDB, DuckDB, ClickHouse, SQL Server, Oracle, Elasticsearch, Qdrant, Milvus, Weaviate, MariaDB, TiDB, OceanBase, openGauss, GaussDB, KWDB, KingBase, Vastbase, GoldenDB, Doris, SelectDB, StarRocks, Manticore Search, Redshift, DM, TDengine, XuguDB, CockroachDB, Access, HighGo, UXDB, and more. Agent/JDBC-oriented profiles extend support to H2, Snowflake, Trino, PrestoSQL, Hive, DB2, Informix, Neo4j, Cassandra, BigQuery, Kylin, SunDB, JDBCX, Databricks, SAP HANA, Teradata, Vertica, Firebird, Exasol, YashanDB, GBase 8a/8s, Databend, RQLite, Turso, InfluxDB, QuestDB, IoTDB, etcd, ZooKeeper, Nacos, IRIS, and custom JDBC connections. Message queue admin (Pulsar, Kafka, RocketMQ) is also supported.
</details> </details>
<details> <details>
+2 -2
View File
@@ -90,7 +90,7 @@
### 70+ 种数据库,一个工具搞定 ### 70+ 种数据库,一个工具搞定
MySQL、PostgreSQL、SQLite、Cloudflare D1、Redis、MongoDB、DuckDB、ClickHouse、SQL Server、Oracle、Elasticsearch、MariaDB、TiDB、OceanBase、openGauss、GaussDB、KWDB、KingBase、Vastbase、GoldenDB、Doris、SelectDB、StarRocks、Manticore Search、Redshift、DM、TDengine、虚谷 XuguDB、CockroachDB、Access、HighGo 等数据库都能直接连接。Agent/JDBC 方向的配置还可扩展到 H2、Snowflake、Trino、Hive、DB2、Informix、Neo4j、Cassandra、BigQuery、Kylin、SunDB、JDBCX 和自定义 JDBC。新增的原生与 Agent 驱动还覆盖了 Databricks、SAP HANA、Teradata、Vertica、Firebird、Exasol、崖山 YashanDB、GBase、Databend、RQLite、Turso、InfluxDB、QuestDB、IoTDB、etcd、IRIS 等。全部装进约 20 MB 的应用里,不内嵌 Chromium。 MySQL、PostgreSQL、SQLite、Cloudflare D1、Redis、MongoDB、DuckDB、ClickHouse、SQL Server、Oracle、Elasticsearch、MariaDB、TiDB、OceanBase、openGauss、GaussDB、KWDB、KingBase、Vastbase、GoldenDB、Doris、SelectDB、StarRocks、Manticore Search、Redshift、DM、TDengine、虚谷 XuguDB、CockroachDB、Access、HighGo、UXDB 等数据库都能直接连接。Agent/JDBC 方向的配置还可扩展到 H2、Snowflake、Trino、Hive、DB2、Informix、Neo4j、Cassandra、BigQuery、Kylin、SunDB、JDBCX 和自定义 JDBC。新增的原生与 Agent 驱动还覆盖了 Databricks、SAP HANA、Teradata、Vertica、Firebird、Exasol、崖山 YashanDB、GBase、Databend、RQLite、Turso、InfluxDB、QuestDB、IoTDB、etcd、IRIS 等。全部装进约 20 MB 的应用里,不内嵌 Chromium。
### 查询编辑器 ### 查询编辑器
@@ -426,7 +426,7 @@ DBX 仅 20 MB,无需运行时依赖(无需 Java、无需 Python)。AI 和
<details> <details>
<summary><strong>支持哪些数据库?</strong></summary> <summary><strong>支持哪些数据库?</strong></summary>
MySQL、PostgreSQL、SQLite、Cloudflare D1、Redis、MongoDB、DuckDB、ClickHouse、SQL Server、Oracle、Elasticsearch、Qdrant、Milvus、Weaviate、MariaDB、TiDB、OceanBase、openGauss、GaussDB、KWDB、KingBase、Vastbase、GoldenDB、Doris、SelectDB、StarRocks、Manticore Search、Redshift、DM、TDengine、虚谷 XuguDB、CockroachDB、Access、HighGo 等。JDBC 方向配置可扩展到 H2、Snowflake、Trino、PrestoSQL、Hive、DB2、Informix、Neo4j、Cassandra、BigQuery、Kylin、SunDB、JDBCX、Databricks、SAP HANA、Teradata、Vertica、Firebird、Exasol、崖山 YashanDB、GBase 8a/8s、Databend、RQLite、Turso、InfluxDB、QuestDB、IoTDB、etcd、ZooKeeper、Nacos、IRIS 及自定义 JDBC 连接,并支持消息队列管理(Pulsar、Kafka、RocketMQ)。 MySQL、PostgreSQL、SQLite、Cloudflare D1、Redis、MongoDB、DuckDB、ClickHouse、SQL Server、Oracle、Elasticsearch、Qdrant、Milvus、Weaviate、MariaDB、TiDB、OceanBase、openGauss、GaussDB、KWDB、KingBase、Vastbase、GoldenDB、Doris、SelectDB、StarRocks、Manticore Search、Redshift、DM、TDengine、虚谷 XuguDB、CockroachDB、Access、HighGo、UXDB 等。JDBC 方向配置可扩展到 H2、Snowflake、Trino、PrestoSQL、Hive、DB2、Informix、Neo4j、Cassandra、BigQuery、Kylin、SunDB、JDBCX、Databricks、SAP HANA、Teradata、Vertica、Firebird、Exasol、崖山 YashanDB、GBase 8a/8s、Databend、RQLite、Turso、InfluxDB、QuestDB、IoTDB、etcd、ZooKeeper、Nacos、IRIS 及自定义 JDBC 连接,并支持消息队列管理(Pulsar、Kafka、RocketMQ)。
</details> </details>
<details> <details>
+1
View File
@@ -1,5 +1,6 @@
**/libs/*.jar **/libs/*.jar
!drivers/oscar/libs/oscarJDBC8.jar !drivers/oscar/libs/oscarJDBC8.jar
!drivers/uxdb/libs/uxdbjdbc-2.1.2.3p.jre8.jar
gradle.properties gradle.properties
build/ build/
*/bin/ */bin/
+1
View File
@@ -14,6 +14,7 @@ Each agent runs as a standalone process and communicates with DBX via stdin/stdo
| dameng | 达梦 DM8 | DM JDBC | | dameng | 达梦 DM8 | DM JDBC |
| kingbase | 人大金仓 KingbaseES | gokb Go native agent | | kingbase | 人大金仓 KingbaseES | gokb Go native agent |
| vastbase | Vastbase | Vastbase JDBC | | vastbase | Vastbase | Vastbase JDBC |
| uxdb | UXDB | UXDB JDBC |
| goldendb | GoldenDB | MySQL Connector/J | | goldendb | GoldenDB | MySQL Connector/J |
| databend | Databend | Databend JDBC | | databend | Databend | Databend JDBC |
| databricks | Databricks SQL | Databricks JDBC | | databricks | Databricks SQL | Databricks JDBC |
+1
View File
@@ -14,6 +14,7 @@ DBX 的 Agent 驱动 —— 通过 JDBC 和原生数据库驱动支持各种数
| dameng | 达梦 DM8 | DM JDBC | | dameng | 达梦 DM8 | DM JDBC |
| kingbase | 人大金仓 KingbaseES | gokb Go 原生 agent | | kingbase | 人大金仓 KingbaseES | gokb Go 原生 agent |
| vastbase | Vastbase | Vastbase JDBC | | vastbase | Vastbase | Vastbase JDBC |
| uxdb | 优炫 UXDB | UXDB JDBC |
| goldendb | GoldenDB | MySQL Connector/J | | goldendb | GoldenDB | MySQL Connector/J |
| databend | Databend | Databend JDBC | | databend | Databend | Databend JDBC |
| databricks | Databricks SQL | Databricks JDBC | | databricks | Databricks SQL | Databricks JDBC |
@@ -136,7 +136,9 @@ public abstract class PostgresLikeAgent extends AbstractJdbcAgent {
public List<DatabaseInfo> listDatabases() { public List<DatabaseInfo> listDatabases() {
return unchecked(() -> { return unchecked(() -> {
List<DatabaseInfo> result = new ArrayList<>(); List<DatabaseInfo> result = new ArrayList<>();
try (java.sql.PreparedStatement stmt = requireConnection().prepareStatement("SELECT datname FROM pg_catalog.pg_database WHERE datistemplate = false ORDER BY datname"); String sql = "SELECT datname FROM " + profile.catalogRelation("database") +
" WHERE datistemplate = false ORDER BY datname";
try (java.sql.PreparedStatement stmt = requireConnection().prepareStatement(sql);
ResultSet rs = stmt.executeQuery()) { ResultSet rs = stmt.executeQuery()) {
while (rs.next()) { while (rs.next()) {
result.add(new DatabaseInfo(rs.getString("datname"))); result.add(new DatabaseInfo(rs.getString("datname")));
@@ -152,10 +154,10 @@ public abstract class PostgresLikeAgent extends AbstractJdbcAgent {
List<String> result = new ArrayList<>(); List<String> result = new ArrayList<>();
try (java.sql.PreparedStatement stmt = requireConnection().prepareStatement( try (java.sql.PreparedStatement stmt = requireConnection().prepareStatement(
"SELECT n.nspname AS schema_name " + "SELECT n.nspname AS schema_name " +
"FROM pg_catalog.pg_namespace n " + "FROM " + profile.catalogRelation("namespace") + " n " +
"WHERE n.nspname NOT IN ('pg_catalog','information_schema','pg_toast') " + "WHERE n.nspname NOT IN ('" + profile.getCatalogSchema() + "','information_schema','" + profile.getToastSchema() + "') " +
"AND n.nspname NOT LIKE 'pg_toast_temp_%' " + "AND n.nspname NOT LIKE '" + profile.getToastTemporarySchemaPrefix() + "%' " +
"AND n.nspname NOT LIKE 'pg_temp_%' " + "AND n.nspname NOT LIKE '" + profile.getTemporarySchemaPrefix() + "%' " +
"ORDER BY n.nspname" "ORDER BY n.nspname"
); ResultSet rs = stmt.executeQuery()) { ); ResultSet rs = stmt.executeQuery()) {
while (rs.next()) { while (rs.next()) {
@@ -179,9 +181,9 @@ public abstract class PostgresLikeAgent extends AbstractJdbcAgent {
"WHEN 'm' THEN 'MATERIALIZED VIEW' " + "WHEN 'm' THEN 'MATERIALIZED VIEW' " +
"WHEN 'f' THEN 'FOREIGN TABLE' " + "WHEN 'f' THEN 'FOREIGN TABLE' " +
"ELSE 'TABLE' END AS table_type, " + "ELSE 'TABLE' END AS table_type, " +
"obj_description(c.oid) AS table_comment " + profile.catalogBuiltinFunction("obj_description") + "(c.oid) AS table_comment " +
"FROM pg_catalog.pg_class c " + "FROM " + profile.catalogRelation("class") + " c " +
"JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace " + "JOIN " + profile.catalogRelation("namespace") + " n ON n.oid = c.relnamespace " +
"WHERE n.nspname = ? AND c.relkind IN ('r','p','v','m','f') " + "WHERE n.nspname = ? AND c.relkind IN ('r','p','v','m','f') " +
"ORDER BY c.relname" "ORDER BY c.relname"
)) { )) {
@@ -207,8 +209,8 @@ public abstract class PostgresLikeAgent extends AbstractJdbcAgent {
try (java.sql.PreparedStatement stmt = requireConnection().prepareStatement( try (java.sql.PreparedStatement stmt = requireConnection().prepareStatement(
"SELECT p.proname AS routine_name, " + "SELECT p.proname AS routine_name, " +
"CASE p.prokind WHEN 'p' THEN 'PROCEDURE' ELSE 'FUNCTION' END AS routine_type " + "CASE p.prokind WHEN 'p' THEN 'PROCEDURE' ELSE 'FUNCTION' END AS routine_type " +
"FROM pg_catalog.pg_proc p " + "FROM " + profile.catalogRelation("proc") + " p " +
"JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace " + "JOIN " + profile.catalogRelation("namespace") + " n ON n.oid = p.pronamespace " +
"WHERE n.nspname = ? AND p.prokind IN ('p','f') " + "WHERE n.nspname = ? AND p.prokind IN ('p','f') " +
"ORDER BY p.proname" "ORDER BY p.proname"
)) { )) {
@@ -221,8 +223,8 @@ public abstract class PostgresLikeAgent extends AbstractJdbcAgent {
} }
try (java.sql.PreparedStatement stmt = requireConnection().prepareStatement( try (java.sql.PreparedStatement stmt = requireConnection().prepareStatement(
"SELECT c.relname AS sequence_name, 'SEQUENCE' AS object_type " + "SELECT c.relname AS sequence_name, 'SEQUENCE' AS object_type " +
"FROM pg_catalog.pg_class c " + "FROM " + profile.catalogRelation("class") + " c " +
"JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace " + "JOIN " + profile.catalogRelation("namespace") + " n ON n.oid = c.relnamespace " +
"WHERE n.nspname = ? AND c.relkind = 'S' " + "WHERE n.nspname = ? AND c.relkind = 'S' " +
"ORDER BY c.relname" "ORDER BY c.relname"
)) { )) {
@@ -286,9 +288,9 @@ public abstract class PostgresLikeAgent extends AbstractJdbcAgent {
public String getTableComment(String schema, String table) { public String getTableComment(String schema, String table) {
return unchecked(() -> { return unchecked(() -> {
try (java.sql.PreparedStatement stmt = requireConnection().prepareStatement( try (java.sql.PreparedStatement stmt = requireConnection().prepareStatement(
"SELECT obj_description(c.oid) AS table_comment " + "SELECT " + profile.catalogBuiltinFunction("obj_description") + "(c.oid) AS table_comment " +
"FROM pg_catalog.pg_class c " + "FROM " + profile.catalogRelation("class") + " c " +
"JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace " + "JOIN " + profile.catalogRelation("namespace") + " n ON n.oid = c.relnamespace " +
"WHERE n.nspname = ? AND c.relname = ? AND c.relkind IN ('r','m','f','p') " + "WHERE n.nspname = ? AND c.relname = ? AND c.relkind IN ('r','m','f','p') " +
"LIMIT 1" "LIMIT 1"
)) { )) {
@@ -308,10 +310,11 @@ public abstract class PostgresLikeAgent extends AbstractJdbcAgent {
protected List<CheckConstraintInfo> listCheckConstraints(String schema, String table) { protected List<CheckConstraintInfo> listCheckConstraints(String schema, String table) {
return unchecked(() -> { return unchecked(() -> {
List<CheckConstraintInfo> result = new ArrayList<>(); List<CheckConstraintInfo> result = new ArrayList<>();
String sql = "SELECT co.conname AS constraint_name, pg_catalog.pg_get_constraintdef(co.oid, true) AS constraint_definition " + String sql = "SELECT co.conname AS constraint_name, " +
"FROM pg_catalog.pg_constraint co " + profile.catalogPrefixedFunction("get_constraintdef") + "(co.oid, true) AS constraint_definition " +
"JOIN pg_catalog.pg_class c ON c.oid = co.conrelid " + "FROM " + profile.catalogRelation("constraint") + " co " +
"JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace " + "JOIN " + profile.catalogRelation("class") + " c ON c.oid = co.conrelid " +
"JOIN " + profile.catalogRelation("namespace") + " n ON n.oid = c.relnamespace " +
"WHERE co.contype = 'c' AND n.nspname = ? AND c.relname = ? " + "WHERE co.contype = 'c' AND n.nspname = ? AND c.relname = ? " +
"ORDER BY co.conname"; "ORDER BY co.conname";
try (java.sql.PreparedStatement stmt = requireConnection().prepareStatement(sql)) { try (java.sql.PreparedStatement stmt = requireConnection().prepareStatement(sql)) {
@@ -336,15 +339,18 @@ public abstract class PostgresLikeAgent extends AbstractJdbcAgent {
String upperType = objectType.toUpperCase(); String upperType = objectType.toUpperCase();
String sql; String sql;
if ("VIEW".equals(upperType) || "MATERIALIZED VIEW".equals(upperType)) { if ("VIEW".equals(upperType) || "MATERIALIZED VIEW".equals(upperType)) {
sql = "SELECT pg_catalog.pg_get_viewdef(pg_catalog.to_regclass(?), true)"; sql = "SELECT " + profile.catalogPrefixedFunction("get_viewdef") + "(" +
profile.catalogBuiltinFunction("to_regclass") + "(?), true)";
} else if ("FUNCTION".equals(upperType)) { } else if ("FUNCTION".equals(upperType)) {
sql = "SELECT pg_catalog.pg_get_functiondef(p.oid)\n" + sql = "SELECT " + profile.catalogPrefixedFunction("get_functiondef") + "(p.oid)\n" +
"FROM pg_catalog.pg_proc p JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace\n" + "FROM " + profile.catalogRelation("proc") + " p JOIN " +
profile.catalogRelation("namespace") + " n ON n.oid = p.pronamespace\n" +
"WHERE n.nspname = ? AND p.proname = ? AND p.prokind = 'f'\n" + "WHERE n.nspname = ? AND p.proname = ? AND p.prokind = 'f'\n" +
"ORDER BY p.oid LIMIT 1"; "ORDER BY p.oid LIMIT 1";
} else if ("PROCEDURE".equals(upperType)) { } else if ("PROCEDURE".equals(upperType)) {
sql = "SELECT pg_catalog.pg_get_functiondef(p.oid)\n" + sql = "SELECT " + profile.catalogPrefixedFunction("get_functiondef") + "(p.oid)\n" +
"FROM pg_catalog.pg_proc p JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace\n" + "FROM " + profile.catalogRelation("proc") + " p JOIN " +
profile.catalogRelation("namespace") + " n ON n.oid = p.pronamespace\n" +
"WHERE n.nspname = ? AND p.proname = ? AND p.prokind = 'p'\n" + "WHERE n.nspname = ? AND p.proname = ? AND p.prokind = 'p'\n" +
"ORDER BY p.oid LIMIT 1"; "ORDER BY p.oid LIMIT 1";
} else { } else {
@@ -378,21 +384,21 @@ public abstract class PostgresLikeAgent extends AbstractJdbcAgent {
Set<String> primaryKeys = primaryKeys(schema, table); Set<String> primaryKeys = primaryKeys(schema, table);
List<ColumnInfo> result = new ArrayList<>(); List<ColumnInfo> result = new ArrayList<>();
String sql = "SELECT a.attname AS column_name, " + String sql = "SELECT a.attname AS column_name, " +
"format_type(a.atttypid, a.atttypmod) AS data_type, " + profile.catalogBuiltinFunction("format_type") + "(a.atttypid, a.atttypmod) AS data_type, " +
"NOT a.attnotnull AS is_nullable, " + "NOT a.attnotnull AS is_nullable, " +
"pg_get_expr(ad.adbin, ad.adrelid) AS column_default, " + profile.catalogPrefixedFunction("get_expr") + "(ad.adbin, ad.adrelid) AS column_default, " +
"col_description(a.attrelid, a.attnum) AS column_comment, " + profile.catalogBuiltinFunction("col_description") + "(a.attrelid, a.attnum) AS column_comment, " +
"CASE WHEN t.typname = 'numeric' AND a.atttypmod > 0 " + "CASE WHEN t.typname = 'numeric' AND a.atttypmod > 0 " +
"THEN ((a.atttypmod - 4) >> 16) & 65535 ELSE NULL END AS numeric_precision, " + "THEN ((a.atttypmod - 4) >> 16) & 65535 ELSE NULL END AS numeric_precision, " +
"CASE WHEN t.typname = 'numeric' AND a.atttypmod > 0 " + "CASE WHEN t.typname = 'numeric' AND a.atttypmod > 0 " +
"THEN (a.atttypmod - 4) & 65535 ELSE NULL END AS numeric_scale, " + "THEN (a.atttypmod - 4) & 65535 ELSE NULL END AS numeric_scale, " +
"CASE WHEN t.typname IN ('varchar', 'bpchar') AND a.atttypmod > 0 " + "CASE WHEN t.typname IN ('varchar', 'bpchar') AND a.atttypmod > 0 " +
"THEN a.atttypmod - 4 ELSE NULL END AS character_maximum_length " + "THEN a.atttypmod - 4 ELSE NULL END AS character_maximum_length " +
"FROM pg_catalog.pg_attribute a " + "FROM " + profile.catalogRelation("attribute") + " a " +
"JOIN pg_catalog.pg_type t ON t.oid = a.atttypid " + "JOIN " + profile.catalogRelation("type") + " t ON t.oid = a.atttypid " +
"JOIN pg_catalog.pg_class c ON c.oid = a.attrelid " + "JOIN " + profile.catalogRelation("class") + " c ON c.oid = a.attrelid " +
"JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace " + "JOIN " + profile.catalogRelation("namespace") + " n ON n.oid = c.relnamespace " +
"LEFT JOIN pg_catalog.pg_attrdef ad ON ad.adrelid = a.attrelid AND ad.adnum = a.attnum " + "LEFT JOIN " + profile.catalogRelation("attrdef") + " ad ON ad.adrelid = a.attrelid AND ad.adnum = a.attnum " +
"WHERE n.nspname = ? AND c.relname = ? " + "WHERE n.nspname = ? AND c.relname = ? " +
"AND a.attnum > 0 AND NOT a.attisdropped " + "AND a.attnum > 0 AND NOT a.attisdropped " +
"ORDER BY a.attnum"; "ORDER BY a.attnum";
@@ -425,11 +431,11 @@ public abstract class PostgresLikeAgent extends AbstractJdbcAgent {
return unchecked(() -> { return unchecked(() -> {
Set<String> primaryKeys = new LinkedHashSet<>(); Set<String> primaryKeys = new LinkedHashSet<>();
String sql = "SELECT a.attname AS column_name " + String sql = "SELECT a.attname AS column_name " +
"FROM pg_catalog.pg_constraint co " + "FROM " + profile.catalogRelation("constraint") + " co " +
"JOIN pg_catalog.pg_class c ON c.oid = co.conrelid " + "JOIN " + profile.catalogRelation("class") + " c ON c.oid = co.conrelid " +
"JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace " + "JOIN " + profile.catalogRelation("namespace") + " n ON n.oid = c.relnamespace " +
"JOIN LATERAL (SELECT unnest(co.conkey) AS attnum, generate_series(1, array_length(co.conkey, 1)) AS ord) AS pk_cols ON true " + "JOIN LATERAL (SELECT unnest(co.conkey) AS attnum, generate_series(1, array_length(co.conkey, 1)) AS ord) AS pk_cols ON true " +
"JOIN pg_catalog.pg_attribute a ON a.attrelid = c.oid AND a.attnum = pk_cols.attnum " + "JOIN " + profile.catalogRelation("attribute") + " a ON a.attrelid = c.oid AND a.attnum = pk_cols.attnum " +
"WHERE co.contype = 'p' " + "WHERE co.contype = 'p' " +
"AND n.nspname = ? " + "AND n.nspname = ? " +
"AND c.relname = ? " + "AND c.relname = ? " +
@@ -454,13 +460,13 @@ public abstract class PostgresLikeAgent extends AbstractJdbcAgent {
String sql = "SELECT i.relname AS index_name, am.amname AS index_type, " + String sql = "SELECT i.relname AS index_name, am.amname AS index_type, " +
"ix.indisunique AS is_unique, ix.indisprimary AS is_primary, " + "ix.indisunique AS is_unique, ix.indisprimary AS is_primary, " +
"array_agg(a.attname ORDER BY k.n) AS columns " + "array_agg(a.attname ORDER BY k.n) AS columns " +
"FROM pg_catalog.pg_index ix " + "FROM " + profile.catalogRelation("index") + " ix " +
"JOIN pg_catalog.pg_class t ON t.oid = ix.indrelid " + "JOIN " + profile.catalogRelation("class") + " t ON t.oid = ix.indrelid " +
"JOIN pg_catalog.pg_class i ON i.oid = ix.indexrelid " + "JOIN " + profile.catalogRelation("class") + " i ON i.oid = ix.indexrelid " +
"JOIN pg_catalog.pg_namespace n ON n.oid = t.relnamespace " + "JOIN " + profile.catalogRelation("namespace") + " n ON n.oid = t.relnamespace " +
"JOIN pg_catalog.pg_am am ON am.oid = i.relam " + "JOIN " + profile.catalogRelation("am") + " am ON am.oid = i.relam " +
"JOIN LATERAL (SELECT unnest(ix.indkey) AS attnum, generate_series(1, array_length(ix.indkey, 1)) AS n) AS k ON true " + "JOIN LATERAL (SELECT unnest(ix.indkey) AS attnum, generate_series(1, array_length(ix.indkey, 1)) AS n) AS k ON true " +
"JOIN pg_catalog.pg_attribute a ON a.attrelid = t.oid AND a.attnum = k.attnum " + "JOIN " + profile.catalogRelation("attribute") + " a ON a.attrelid = t.oid AND a.attnum = k.attnum " +
"WHERE n.nspname = ? AND t.relname = ? " + "WHERE n.nspname = ? AND t.relname = ? " +
"GROUP BY i.relname, am.amname, ix.indisunique, ix.indisprimary " + "GROUP BY i.relname, am.amname, ix.indisunique, ix.indisprimary " +
"ORDER BY i.relname"; "ORDER BY i.relname";
@@ -499,14 +505,14 @@ public abstract class PostgresLikeAgent extends AbstractJdbcAgent {
"a.attname AS column_name, " + "a.attname AS column_name, " +
"rc.relname AS ref_table, " + "rc.relname AS ref_table, " +
"ra.attname AS ref_column " + "ra.attname AS ref_column " +
"FROM pg_catalog.pg_constraint co " + "FROM " + profile.catalogRelation("constraint") + " co " +
"JOIN pg_catalog.pg_class c ON c.oid = co.conrelid " + "JOIN " + profile.catalogRelation("class") + " c ON c.oid = co.conrelid " +
"JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace " + "JOIN " + profile.catalogRelation("namespace") + " n ON n.oid = c.relnamespace " +
"JOIN pg_catalog.pg_class rc ON rc.oid = co.confrelid " + "JOIN " + profile.catalogRelation("class") + " rc ON rc.oid = co.confrelid " +
"JOIN LATERAL (SELECT unnest(co.conkey) AS attnum, generate_series(1, array_length(co.conkey, 1)) AS ord) AS fk ON true " + "JOIN LATERAL (SELECT unnest(co.conkey) AS attnum, generate_series(1, array_length(co.conkey, 1)) AS ord) AS fk ON true " +
"JOIN pg_catalog.pg_attribute a ON a.attrelid = c.oid AND a.attnum = fk.attnum " + "JOIN " + profile.catalogRelation("attribute") + " a ON a.attrelid = c.oid AND a.attnum = fk.attnum " +
"JOIN LATERAL (SELECT unnest(co.confkey) AS attnum, generate_series(1, array_length(co.confkey, 1)) AS ord) AS pk ON pk.ord = fk.ord " + "JOIN LATERAL (SELECT unnest(co.confkey) AS attnum, generate_series(1, array_length(co.confkey, 1)) AS ord) AS pk ON pk.ord = fk.ord " +
"JOIN pg_catalog.pg_attribute ra ON ra.attrelid = rc.oid AND ra.attnum = pk.attnum " + "JOIN " + profile.catalogRelation("attribute") + " ra ON ra.attrelid = rc.oid AND ra.attnum = pk.attnum " +
"WHERE co.contype = 'f' " + "WHERE co.contype = 'f' " +
"AND n.nspname = ? " + "AND n.nspname = ? " +
"AND c.relname = ? " + "AND c.relname = ? " +
@@ -541,9 +547,9 @@ public abstract class PostgresLikeAgent extends AbstractJdbcAgent {
"CASE WHEN (tg.tgtype & 32) <> 0 THEN 'TRUNCATE,' ELSE '' END" + "CASE WHEN (tg.tgtype & 32) <> 0 THEN 'TRUNCATE,' ELSE '' END" +
")) AS event_manipulation, " + ")) AS event_manipulation, " +
"CASE WHEN (tg.tgtype & 2) <> 0 THEN 'BEFORE' ELSE 'AFTER' END AS action_timing " + "CASE WHEN (tg.tgtype & 2) <> 0 THEN 'BEFORE' ELSE 'AFTER' END AS action_timing " +
"FROM pg_catalog.pg_trigger tg " + "FROM " + profile.catalogRelation("trigger") + " tg " +
"JOIN pg_catalog.pg_class c ON c.oid = tg.tgrelid " + "JOIN " + profile.catalogRelation("class") + " c ON c.oid = tg.tgrelid " +
"JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace " + "JOIN " + profile.catalogRelation("namespace") + " n ON n.oid = c.relnamespace " +
"WHERE n.nspname = ? AND c.relname = ? AND NOT tg.tgisinternal " + "WHERE n.nspname = ? AND c.relname = ? AND NOT tg.tgisinternal " +
"ORDER BY tg.tgname"; "ORDER BY tg.tgname";
try (java.sql.PreparedStatement stmt = requireConnection().prepareStatement(sql)) { try (java.sql.PreparedStatement stmt = requireConnection().prepareStatement(sql)) {
@@ -3,10 +3,38 @@ package com.dbx.agent;
public final class PostgresLikeAgentProfile { public final class PostgresLikeAgentProfile {
private final String driverClass; private final String driverClass;
private final String urlTemplate; private final String urlTemplate;
private final int defaultPort;
private final String catalogSchema;
private final String catalogPrefix;
public PostgresLikeAgentProfile(String driverClass, String urlTemplate) { public PostgresLikeAgentProfile(String driverClass, String urlTemplate) {
this(driverClass, urlTemplate, 0, "pg_catalog", "pg_");
}
public PostgresLikeAgentProfile(
String driverClass,
String urlTemplate,
String catalogSchema,
String catalogPrefix
) {
this(driverClass, urlTemplate, 0, catalogSchema, catalogPrefix);
}
public PostgresLikeAgentProfile(
String driverClass,
String urlTemplate,
int defaultPort,
String catalogSchema,
String catalogPrefix
) {
this.driverClass = driverClass; this.driverClass = driverClass;
this.urlTemplate = urlTemplate; this.urlTemplate = urlTemplate;
this.defaultPort = defaultPort;
// PostgreSQL derivatives may preserve catalog semantics while renaming every
// relation and helper function. Centralize that mapping instead of copying
// the full metadata implementation for each compatible database.
this.catalogSchema = catalogSchema;
this.catalogPrefix = catalogPrefix;
} }
public String getDriverClass() { public String getDriverClass() {
@@ -17,11 +45,39 @@ public final class PostgresLikeAgentProfile {
return urlTemplate; return urlTemplate;
} }
public String getCatalogSchema() {
return catalogSchema;
}
public String getToastSchema() {
return catalogPrefix + "toast";
}
public String getTemporarySchemaPrefix() {
return catalogPrefix + "temp_";
}
public String getToastTemporarySchemaPrefix() {
return catalogPrefix + "toast_temp_";
}
public String catalogRelation(String name) {
return catalogSchema + "." + catalogPrefix + name;
}
public String catalogPrefixedFunction(String name) {
return catalogSchema + "." + catalogPrefix + name;
}
public String catalogBuiltinFunction(String name) {
return catalogSchema + "." + name;
}
public String buildUrl(ConnectParams params) { public String buildUrl(ConnectParams params) {
return new JdbcAgentProfile( return new JdbcAgentProfile(
driverClass, driverClass,
urlTemplate, urlTemplate,
0, defaultPort,
false, false,
java.util.Collections.emptySet(), java.util.Collections.emptySet(),
java.util.Arrays.asList("TABLE", "VIEW", "MATERIALIZED VIEW", "SYSTEM TABLE", "SYSTEM VIEW") java.util.Arrays.asList("TABLE", "VIEW", "MATERIALIZED VIEW", "SYSTEM TABLE", "SYSTEM VIEW")
@@ -54,6 +54,40 @@ class PostgresLikeAgentTest {
assertFalse(sql.contains(" key."), sql); assertFalse(sql.contains(" key."), sql);
} }
@Test
void metadataQueriesSupportRenamedPostgresCatalogs() {
TestPostgresLikeAgent agent = new TestPostgresLikeAgent(new PostgresLikeAgentProfile(
PostgresLikeAgentTest.class.getName(),
"jdbc:uxdb://{host}:{port}/{database}",
52025,
"ux_catalog",
"ux_"
));
agent.connect(new ConnectParams());
agent.listDatabases();
agent.listSchemas();
agent.listTables("app");
agent.listObjects("app");
agent.getObjectSource("app", "refresh_orders", "FUNCTION");
agent.getColumns("app", "orders");
agent.listCheckConstraintsForTest("app", "orders");
agent.listIndexes("app", "orders");
agent.listForeignKeys("app", "orders");
agent.listTriggers("app", "orders");
String sql = String.join("\n", MetadataSqlFake.statements);
assertTrue(sql.contains("ux_catalog.ux_database"), sql);
assertTrue(sql.contains("ux_catalog.ux_namespace"), sql);
assertTrue(sql.contains("ux_catalog.ux_class"), sql);
assertTrue(sql.contains("ux_catalog.ux_proc"), sql);
assertTrue(sql.contains("ux_catalog.ux_get_constraintdef"), sql);
assertTrue(sql.contains("ux_catalog.ux_get_functiondef"), sql);
assertTrue(sql.contains("ux_catalog.ux_get_expr"), sql);
assertFalse(sql.contains("pg_catalog"), sql);
}
@Test @Test
void mapsPgCatalogBooleanNullableValues() { void mapsPgCatalogBooleanNullableValues() {
TestPostgresLikeAgent agent = new TestPostgresLikeAgent(preparedConnection( TestPostgresLikeAgent agent = new TestPostgresLikeAgent(preparedConnection(
@@ -156,14 +190,22 @@ class PostgresLikeAgentTest {
private final Connection connection; private final Connection connection;
private TestPostgresLikeAgent() { private TestPostgresLikeAgent() {
this(null); this((Connection) null);
} }
private TestPostgresLikeAgent(Connection connection) { private TestPostgresLikeAgent(Connection connection) {
super(new PostgresLikeAgentProfile( this(new PostgresLikeAgentProfile(
PostgresLikeAgentTest.class.getName(), PostgresLikeAgentTest.class.getName(),
"jdbc:test://{host}:{port}/{database}" "jdbc:test://{host}:{port}/{database}"
)); ), connection);
}
private TestPostgresLikeAgent(PostgresLikeAgentProfile profile) {
this(profile, null);
}
private TestPostgresLikeAgent(PostgresLikeAgentProfile profile, Connection connection) {
super(profile);
this.connection = connection; this.connection = connection;
} }
+9
View File
@@ -0,0 +1,9 @@
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
}
tasks.named('shadowJar') {
manifest {
attributes('Agent-Label': 'UXDB', 'Main-Class': 'com.dbx.agent.uxdb.UxdbAgent')
}
}
Binary file not shown.
@@ -0,0 +1,23 @@
package com.dbx.agent.uxdb;
import com.dbx.agent.MultiSessionJsonRpcServer;
import com.dbx.agent.PostgresLikeAgent;
import com.dbx.agent.PostgresLikeAgentProfile;
public final class UxdbAgent extends PostgresLikeAgent {
public static final PostgresLikeAgentProfile UXDB_PROFILE = new PostgresLikeAgentProfile(
"com.uxsino.uxdb.Driver",
"jdbc:uxdb://{host}:{port}/{database}",
52025,
"ux_catalog",
"ux_"
);
public UxdbAgent() {
super(UXDB_PROFILE);
}
public static void main(String[] args) {
new MultiSessionJsonRpcServer(UxdbAgent::new).run();
}
}
@@ -0,0 +1,25 @@
package com.dbx.agent.uxdb;
import com.dbx.agent.ConnectParams;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
class UxdbAgentTest {
@Test
void profileUsesOfficialJdbcSettings() {
assertEquals("com.uxsino.uxdb.Driver", UxdbAgent.UXDB_PROFILE.getDriverClass());
assertEquals("ux_catalog", UxdbAgent.UXDB_PROFILE.getCatalogSchema());
assertEquals("ux_catalog.ux_database", UxdbAgent.UXDB_PROFILE.catalogRelation("database"));
assertEquals(
"jdbc:uxdb://localhost:52025/uxdb",
UxdbAgent.UXDB_PROFILE.buildUrl(new ConnectParams("localhost", 0, "uxdb", "uxdb", "", "", "", false))
);
}
@Test
void usesPostgresStyleSchemaSearchPath() {
assertEquals("SET search_path TO \"public\"", new UxdbAgent().setSchemaSQL("public"));
assertEquals("RESET search_path", new UxdbAgent().resetSchemaSQL());
}
}
+1 -1
View File
@@ -5,7 +5,7 @@ def driverModules = [
'access', 'dameng', 'vastbase', 'goldendb', 'databend', 'databricks', 'saphana', 'access', 'dameng', 'vastbase', 'goldendb', 'databend', 'databricks', 'saphana',
'teradata', 'vertica', 'firebird', 'exasol', 'oceanbase-oracle', 'gbase8a', 'gbase8s', 'teradata', 'vertica', 'firebird', 'exasol', 'oceanbase-oracle', 'gbase8a', 'gbase8s',
'bigquery', 'kylin', 'sundb', 'h2', 'h2-legacy', 'snowflake', 'trino', 'hive', 'spark', 'bigquery', 'kylin', 'sundb', 'h2', 'h2-legacy', 'snowflake', 'trino', 'hive', 'spark',
'db2', 'informix', 'neo4j', 'cassandra', 'mongodb', 'highgo', 'tdengine', 'yashandb', 'oscar', 'db2', 'informix', 'neo4j', 'cassandra', 'mongodb', 'highgo', 'uxdb', 'tdengine', 'yashandb', 'oscar',
'iris', 'iotdb', 'etcd', 'zookeeper', 'kafka', 'rocketmq', 'rabbitmq', 'sqlserver-legacy' 'iris', 'iotdb', 'etcd', 'zookeeper', 'kafka', 'rocketmq', 'rabbitmq', 'sqlserver-legacy'
] ]
+1
View File
@@ -31,6 +31,7 @@
"vertica": "0.1.28", "vertica": "0.1.28",
"mongodb": "0.1.35", "mongodb": "0.1.35",
"highgo": "0.1.31", "highgo": "0.1.31",
"uxdb": "0.1.0",
"yashandb": "0.1.29", "yashandb": "0.1.29",
"oscar": "0.1.8", "oscar": "0.1.8",
"xugu": "0.1.23", "xugu": "0.1.23",
@@ -0,0 +1,149 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="120.000000pt" height="120.000000pt" viewBox="0 0 120.000000 120.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.16, written by Peter Selinger 2001-2019
</metadata>
<g transform="translate(0.000000,120.000000) scale(0.100000,-0.100000)"
fill="#8AA4FF" stroke="#F8FAFC" stroke-width="40" stroke-linejoin="round" paint-order="stroke fill">
<path d="M110 1026 c-18 -22 -5 -48 22 -44 17 2 23 10 23 28 0 29 -26 38 -45
16z"/>
<path d="M1044 1025 c-9 -23 3 -45 26 -45 25 0 37 25 20 45 -16 19 -39 19 -46
0z"/>
<path d="M194 955 c-4 -9 -2 -21 4 -27 15 -15 44 -1 40 19 -4 23 -36 29 -44 8z"/>
<path d="M964 955 c-4 -9 -2 -21 4 -27 15 -15 44 -1 40 19 -4 23 -36 29 -44 8z"/>
<path d="M105 920 c-8 -26 6 -43 31 -38 13 2 19 12 19 28 0 34 -40 41 -50 10z"/>
<path d="M1044 926 c-10 -26 4 -48 28 -44 17 2 23 10 23 28 0 18 -6 26 -23 28
-13 2 -25 -3 -28 -12z"/>
<path d="M297 894 c-14 -14 -7 -35 11 -32 9 2 17 10 17 17 0 16 -18 25 -28 15z"/>
<path d="M884 889 c-10 -17 13 -36 27 -22 12 12 4 33 -11 33 -5 0 -12 -5 -16
-11z"/>
<path d="M200 875 c-15 -18 -5 -35 21 -35 12 0 19 7 19 19 0 24 -25 34 -40 16z"/>
<path d="M970 875 c-15 -18 -5 -35 21 -35 12 0 19 7 19 19 0 24 -25 34 -40 16z"/>
<path d="M106 824 c-9 -22 17 -49 39 -40 10 3 15 15 13 28 -4 29 -42 37 -52
12z"/>
<path d="M1044 826 c-10 -26 4 -48 28 -44 17 2 23 10 23 28 0 18 -6 26 -23 28
-13 2 -25 -3 -28 -12z"/>
<path d="M290 815 c0 -10 7 -15 17 -13 22 4 23 22 1 26 -11 2 -18 -3 -18 -13z"/>
<path d="M887 823 c-13 -12 -7 -23 13 -23 11 0 20 7 20 15 0 15 -21 21 -33 8z"/>
<path d="M385 810 c-3 -5 1 -10 10 -10 9 0 13 5 10 10 -3 6 -8 10 -10 10 -2 0
-7 -4 -10 -10z"/>
<path d="M800 810 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M194 785 c-4 -10 -1 -21 7 -26 20 -12 34 -5 34 17 0 24 -33 31 -41 9z"/>
<path d="M964 789 c-3 -6 0 -18 9 -26 18 -18 37 -9 37 18 0 21 -34 27 -46 8z"/>
<path d="M294 759 c-10 -17 13 -36 27 -22 12 12 4 33 -11 33 -5 0 -12 -5 -16
-11z"/>
<path d="M390 760 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M800 760 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M884 759 c-10 -17 13 -36 27 -22 12 12 4 33 -11 33 -5 0 -12 -5 -16
-11z"/>
<path d="M104 725 c-4 -9 0 -23 9 -32 21 -21 49 -9 45 19 -4 28 -45 38 -54 13z"/>
<path d="M1047 734 c-10 -11 -9 -42 3 -49 20 -12 51 6 48 28 -3 22 -36 35 -51
21z"/>
<path d="M386 721 c-4 -5 -2 -12 3 -15 5 -4 12 -2 15 3 4 5 2 12 -3 15 -5 4
-12 2 -15 -3z"/>
<path d="M806 721 c-4 -7 -5 -15 -2 -18 9 -9 19 4 14 18 -4 11 -6 11 -12 0z"/>
<path d="M194 705 c-4 -9 -2 -21 4 -27 15 -15 44 -1 40 19 -4 23 -36 29 -44 8z"/>
<path d="M966 711 c-10 -16 5 -42 23 -39 21 4 21 42 -1 46 -9 2 -19 -1 -22 -7z"/>
<path d="M290 685 c0 -10 7 -15 17 -13 22 4 23 22 1 26 -11 2 -18 -3 -18 -13z"/>
<path d="M887 694 c-9 -10 2 -24 19 -24 8 0 14 7 14 15 0 15 -21 21 -33 9z"/>
<path d="M385 670 c-3 -5 1 -10 10 -10 9 0 13 5 10 10 -3 6 -8 10 -10 10 -2 0
-7 -4 -10 -10z"/>
<path d="M800 670 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M113 635 c-14 -11 -16 -18 -7 -32 17 -28 48 -23 52 8 4 32 -18 43
-45 24z"/>
<path d="M194 625 c-4 -9 -2 -21 4 -27 15 -15 44 -1 40 19 -4 23 -36 29 -44 8z"/>
<path d="M294 629 c-10 -17 13 -36 27 -22 12 12 4 33 -11 33 -5 0 -12 -5 -16
-11z"/>
<path d="M884 629 c-10 -17 13 -36 27 -22 12 12 4 33 -11 33 -5 0 -12 -5 -16
-11z"/>
<path d="M964 625 c-4 -9 -2 -21 4 -27 15 -15 44 -1 40 19 -4 23 -36 29 -44 8z"/>
<path d="M1047 633 c-13 -12 -7 -41 10 -47 21 -8 48 17 40 38 -6 16 -38 22
-50 9z"/>
<path d="M385 620 c4 -6 11 -8 16 -5 14 9 11 15 -7 15 -8 0 -12 -5 -9 -10z"/>
<path d="M800 620 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M395 570 c-3 -5 1 -10 9 -10 9 0 16 5 16 10 0 6 -4 10 -9 10 -6 0
-13 -4 -16 -10z"/>
<path d="M790 570 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M306 555 c-3 -9 1 -18 10 -22 19 -7 28 2 21 22 -8 19 -23 19 -31 0z"/>
<path d="M876 563 c-12 -12 -6 -33 9 -33 8 0 15 6 15 14 0 17 -14 28 -24 19z"/>
<path d="M210 521 c0 -27 19 -36 37 -18 18 18 9 37 -18 37 -12 0 -19 -7 -19
-19z"/>
<path d="M944 529 c-8 -14 21 -43 35 -35 19 12 13 46 -8 46 -11 0 -23 -5 -27
-11z"/>
<path d="M131 517 c-17 -21 -3 -49 23 -45 15 2 21 10 21 28 0 28 -26 38 -44
17z"/>
<path d="M420 520 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M770 520 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M1027 523 c-4 -3 -7 -17 -7 -30 0 -18 6 -23 24 -23 13 0 27 7 30 16
11 28 -27 57 -47 37z"/>
<path d="M334 489 c-10 -17 13 -36 27 -22 12 12 4 33 -11 33 -5 0 -12 -5 -16
-11z"/>
<path d="M847 493 c-13 -12 -7 -33 8 -33 8 0 15 9 15 20 0 20 -11 26 -23 13z"/>
<path d="M450 480 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M740 480 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M257 453 c-15 -14 -7 -43 12 -43 26 0 36 17 21 35 -14 16 -23 19 -33
8z"/>
<path d="M490 450 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M695 450 c-3 -5 1 -10 10 -10 9 0 13 5 10 10 -3 6 -8 10 -10 10 -2 0
-7 -4 -10 -10z"/>
<path d="M913 449 c-16 -16 -5 -39 19 -39 14 0 19 6 16 22 -4 25 -19 33 -35
17z"/>
<path d="M384 429 c-10 -17 13 -36 27 -22 12 12 4 33 -11 33 -5 0 -12 -5 -16
-11z"/>
<path d="M540 431 c0 -6 5 -13 10 -16 6 -3 10 1 10 9 0 9 -4 16 -10 16 -5 0
-10 -4 -10 -9z"/>
<path d="M650 424 c0 -8 5 -12 10 -9 6 4 8 11 5 16 -9 14 -15 11 -15 -7z"/>
<path d="M794 429 c-10 -17 13 -36 27 -22 12 12 4 33 -11 33 -5 0 -12 -5 -16
-11z"/>
<path d="M595 420 c-3 -5 1 -10 10 -10 9 0 13 5 10 10 -3 6 -8 10 -10 10 -2 0
-7 -4 -10 -10z"/>
<path d="M174 405 c-4 -9 0 -23 8 -31 20 -20 50 -7 46 20 -4 26 -45 35 -54 11z"/>
<path d="M977 413 c-13 -12 -7 -41 10 -47 21 -8 48 17 40 38 -6 16 -38 22 -50
9z"/>
<path d="M440 375 c0 -10 7 -15 17 -13 22 4 23 22 1 26 -11 2 -18 -3 -18 -13z"/>
<path d="M730 375 c0 -8 9 -15 20 -15 11 0 20 7 20 15 0 8 -9 15 -20 15 -11 0
-20 -7 -20 -15z"/>
<path d="M314 365 c-4 -9 -2 -21 4 -27 15 -15 44 -1 40 19 -4 23 -36 29 -44 8z"/>
<path d="M844 365 c-4 -9 -2 -21 4 -27 15 -15 44 -1 40 19 -4 23 -36 29 -44 8z"/>
<path d="M517 364 c-14 -14 -7 -35 11 -32 9 2 17 10 17 17 0 16 -18 25 -28 15z"/>
<path d="M664 359 c-10 -17 13 -36 27 -22 12 12 4 33 -11 33 -5 0 -12 -5 -16
-11z"/>
<path d="M590 335 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0
-15 -7 -15 -15z"/>
<path d="M250 305 c0 -31 26 -43 47 -22 21 21 9 47 -22 47 -20 0 -25 -5 -25
-25z"/>
<path d="M397 323 c-15 -14 -7 -43 12 -43 26 0 36 17 21 35 -14 16 -23 19 -33
8z"/>
<path d="M777 324 c-16 -16 -7 -44 14 -44 15 0 20 5 17 22 -3 22 -19 33 -31
22z"/>
<path d="M894 315 c-4 -9 0 -23 9 -32 21 -21 49 -9 45 19 -4 28 -45 38 -54 13z"/>
<path d="M484 275 c-7 -18 3 -35 21 -35 15 0 24 19 18 38 -6 17 -32 15 -39 -3z"/>
<path d="M680 265 c0 -20 4 -26 18 -23 9 2 17 12 17 23 0 11 -8 21 -17 23 -14
3 -18 -3 -18 -23z"/>
<path d="M353 263 c-18 -6 -16 -50 1 -56 8 -3 22 1 33 8 28 21 -1 62 -34 48z"/>
<path d="M580 250 c0 -13 7 -20 20 -20 13 0 20 7 20 20 0 13 -7 20 -20 20 -13
0 -20 -7 -20 -20z"/>
<path d="M812 258 c-16 -16 -15 -33 4 -48 22 -19 54 12 38 37 -14 22 -27 26
-42 11z"/>
<path d="M454 206 c-10 -26 4 -48 28 -44 17 2 23 10 23 28 0 18 -6 26 -23 28
-13 2 -25 -3 -28 -12z"/>
<path d="M694 206 c-10 -26 4 -48 28 -44 17 2 23 10 23 28 0 18 -6 26 -23 28
-13 2 -25 -3 -28 -12z"/>
<path d="M574 185 c-4 -9 0 -23 8 -31 20 -20 50 -7 46 20 -4 26 -45 35 -54 11z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.6 KiB

+149
View File
@@ -0,0 +1,149 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="120.000000pt" height="120.000000pt" viewBox="0 0 120.000000 120.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.16, written by Peter Selinger 2001-2019
</metadata>
<g transform="translate(0.000000,120.000000) scale(0.100000,-0.100000)"
fill="#142B8C" stroke="#F8FAFC" stroke-width="40" stroke-linejoin="round" paint-order="stroke fill">
<path d="M110 1026 c-18 -22 -5 -48 22 -44 17 2 23 10 23 28 0 29 -26 38 -45
16z"/>
<path d="M1044 1025 c-9 -23 3 -45 26 -45 25 0 37 25 20 45 -16 19 -39 19 -46
0z"/>
<path d="M194 955 c-4 -9 -2 -21 4 -27 15 -15 44 -1 40 19 -4 23 -36 29 -44 8z"/>
<path d="M964 955 c-4 -9 -2 -21 4 -27 15 -15 44 -1 40 19 -4 23 -36 29 -44 8z"/>
<path d="M105 920 c-8 -26 6 -43 31 -38 13 2 19 12 19 28 0 34 -40 41 -50 10z"/>
<path d="M1044 926 c-10 -26 4 -48 28 -44 17 2 23 10 23 28 0 18 -6 26 -23 28
-13 2 -25 -3 -28 -12z"/>
<path d="M297 894 c-14 -14 -7 -35 11 -32 9 2 17 10 17 17 0 16 -18 25 -28 15z"/>
<path d="M884 889 c-10 -17 13 -36 27 -22 12 12 4 33 -11 33 -5 0 -12 -5 -16
-11z"/>
<path d="M200 875 c-15 -18 -5 -35 21 -35 12 0 19 7 19 19 0 24 -25 34 -40 16z"/>
<path d="M970 875 c-15 -18 -5 -35 21 -35 12 0 19 7 19 19 0 24 -25 34 -40 16z"/>
<path d="M106 824 c-9 -22 17 -49 39 -40 10 3 15 15 13 28 -4 29 -42 37 -52
12z"/>
<path d="M1044 826 c-10 -26 4 -48 28 -44 17 2 23 10 23 28 0 18 -6 26 -23 28
-13 2 -25 -3 -28 -12z"/>
<path d="M290 815 c0 -10 7 -15 17 -13 22 4 23 22 1 26 -11 2 -18 -3 -18 -13z"/>
<path d="M887 823 c-13 -12 -7 -23 13 -23 11 0 20 7 20 15 0 15 -21 21 -33 8z"/>
<path d="M385 810 c-3 -5 1 -10 10 -10 9 0 13 5 10 10 -3 6 -8 10 -10 10 -2 0
-7 -4 -10 -10z"/>
<path d="M800 810 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M194 785 c-4 -10 -1 -21 7 -26 20 -12 34 -5 34 17 0 24 -33 31 -41 9z"/>
<path d="M964 789 c-3 -6 0 -18 9 -26 18 -18 37 -9 37 18 0 21 -34 27 -46 8z"/>
<path d="M294 759 c-10 -17 13 -36 27 -22 12 12 4 33 -11 33 -5 0 -12 -5 -16
-11z"/>
<path d="M390 760 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M800 760 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M884 759 c-10 -17 13 -36 27 -22 12 12 4 33 -11 33 -5 0 -12 -5 -16
-11z"/>
<path d="M104 725 c-4 -9 0 -23 9 -32 21 -21 49 -9 45 19 -4 28 -45 38 -54 13z"/>
<path d="M1047 734 c-10 -11 -9 -42 3 -49 20 -12 51 6 48 28 -3 22 -36 35 -51
21z"/>
<path d="M386 721 c-4 -5 -2 -12 3 -15 5 -4 12 -2 15 3 4 5 2 12 -3 15 -5 4
-12 2 -15 -3z"/>
<path d="M806 721 c-4 -7 -5 -15 -2 -18 9 -9 19 4 14 18 -4 11 -6 11 -12 0z"/>
<path d="M194 705 c-4 -9 -2 -21 4 -27 15 -15 44 -1 40 19 -4 23 -36 29 -44 8z"/>
<path d="M966 711 c-10 -16 5 -42 23 -39 21 4 21 42 -1 46 -9 2 -19 -1 -22 -7z"/>
<path d="M290 685 c0 -10 7 -15 17 -13 22 4 23 22 1 26 -11 2 -18 -3 -18 -13z"/>
<path d="M887 694 c-9 -10 2 -24 19 -24 8 0 14 7 14 15 0 15 -21 21 -33 9z"/>
<path d="M385 670 c-3 -5 1 -10 10 -10 9 0 13 5 10 10 -3 6 -8 10 -10 10 -2 0
-7 -4 -10 -10z"/>
<path d="M800 670 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M113 635 c-14 -11 -16 -18 -7 -32 17 -28 48 -23 52 8 4 32 -18 43
-45 24z"/>
<path d="M194 625 c-4 -9 -2 -21 4 -27 15 -15 44 -1 40 19 -4 23 -36 29 -44 8z"/>
<path d="M294 629 c-10 -17 13 -36 27 -22 12 12 4 33 -11 33 -5 0 -12 -5 -16
-11z"/>
<path d="M884 629 c-10 -17 13 -36 27 -22 12 12 4 33 -11 33 -5 0 -12 -5 -16
-11z"/>
<path d="M964 625 c-4 -9 -2 -21 4 -27 15 -15 44 -1 40 19 -4 23 -36 29 -44 8z"/>
<path d="M1047 633 c-13 -12 -7 -41 10 -47 21 -8 48 17 40 38 -6 16 -38 22
-50 9z"/>
<path d="M385 620 c4 -6 11 -8 16 -5 14 9 11 15 -7 15 -8 0 -12 -5 -9 -10z"/>
<path d="M800 620 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M395 570 c-3 -5 1 -10 9 -10 9 0 16 5 16 10 0 6 -4 10 -9 10 -6 0
-13 -4 -16 -10z"/>
<path d="M790 570 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M306 555 c-3 -9 1 -18 10 -22 19 -7 28 2 21 22 -8 19 -23 19 -31 0z"/>
<path d="M876 563 c-12 -12 -6 -33 9 -33 8 0 15 6 15 14 0 17 -14 28 -24 19z"/>
<path d="M210 521 c0 -27 19 -36 37 -18 18 18 9 37 -18 37 -12 0 -19 -7 -19
-19z"/>
<path d="M944 529 c-8 -14 21 -43 35 -35 19 12 13 46 -8 46 -11 0 -23 -5 -27
-11z"/>
<path d="M131 517 c-17 -21 -3 -49 23 -45 15 2 21 10 21 28 0 28 -26 38 -44
17z"/>
<path d="M420 520 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M770 520 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M1027 523 c-4 -3 -7 -17 -7 -30 0 -18 6 -23 24 -23 13 0 27 7 30 16
11 28 -27 57 -47 37z"/>
<path d="M334 489 c-10 -17 13 -36 27 -22 12 12 4 33 -11 33 -5 0 -12 -5 -16
-11z"/>
<path d="M847 493 c-13 -12 -7 -33 8 -33 8 0 15 9 15 20 0 20 -11 26 -23 13z"/>
<path d="M450 480 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M740 480 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M257 453 c-15 -14 -7 -43 12 -43 26 0 36 17 21 35 -14 16 -23 19 -33
8z"/>
<path d="M490 450 c0 -5 5 -10 10 -10 6 0 10 5 10 10 0 6 -4 10 -10 10 -5 0
-10 -4 -10 -10z"/>
<path d="M695 450 c-3 -5 1 -10 10 -10 9 0 13 5 10 10 -3 6 -8 10 -10 10 -2 0
-7 -4 -10 -10z"/>
<path d="M913 449 c-16 -16 -5 -39 19 -39 14 0 19 6 16 22 -4 25 -19 33 -35
17z"/>
<path d="M384 429 c-10 -17 13 -36 27 -22 12 12 4 33 -11 33 -5 0 -12 -5 -16
-11z"/>
<path d="M540 431 c0 -6 5 -13 10 -16 6 -3 10 1 10 9 0 9 -4 16 -10 16 -5 0
-10 -4 -10 -9z"/>
<path d="M650 424 c0 -8 5 -12 10 -9 6 4 8 11 5 16 -9 14 -15 11 -15 -7z"/>
<path d="M794 429 c-10 -17 13 -36 27 -22 12 12 4 33 -11 33 -5 0 -12 -5 -16
-11z"/>
<path d="M595 420 c-3 -5 1 -10 10 -10 9 0 13 5 10 10 -3 6 -8 10 -10 10 -2 0
-7 -4 -10 -10z"/>
<path d="M174 405 c-4 -9 0 -23 8 -31 20 -20 50 -7 46 20 -4 26 -45 35 -54 11z"/>
<path d="M977 413 c-13 -12 -7 -41 10 -47 21 -8 48 17 40 38 -6 16 -38 22 -50
9z"/>
<path d="M440 375 c0 -10 7 -15 17 -13 22 4 23 22 1 26 -11 2 -18 -3 -18 -13z"/>
<path d="M730 375 c0 -8 9 -15 20 -15 11 0 20 7 20 15 0 8 -9 15 -20 15 -11 0
-20 -7 -20 -15z"/>
<path d="M314 365 c-4 -9 -2 -21 4 -27 15 -15 44 -1 40 19 -4 23 -36 29 -44 8z"/>
<path d="M844 365 c-4 -9 -2 -21 4 -27 15 -15 44 -1 40 19 -4 23 -36 29 -44 8z"/>
<path d="M517 364 c-14 -14 -7 -35 11 -32 9 2 17 10 17 17 0 16 -18 25 -28 15z"/>
<path d="M664 359 c-10 -17 13 -36 27 -22 12 12 4 33 -11 33 -5 0 -12 -5 -16
-11z"/>
<path d="M590 335 c0 -8 7 -15 15 -15 8 0 15 7 15 15 0 8 -7 15 -15 15 -8 0
-15 -7 -15 -15z"/>
<path d="M250 305 c0 -31 26 -43 47 -22 21 21 9 47 -22 47 -20 0 -25 -5 -25
-25z"/>
<path d="M397 323 c-15 -14 -7 -43 12 -43 26 0 36 17 21 35 -14 16 -23 19 -33
8z"/>
<path d="M777 324 c-16 -16 -7 -44 14 -44 15 0 20 5 17 22 -3 22 -19 33 -31
22z"/>
<path d="M894 315 c-4 -9 0 -23 9 -32 21 -21 49 -9 45 19 -4 28 -45 38 -54 13z"/>
<path d="M484 275 c-7 -18 3 -35 21 -35 15 0 24 19 18 38 -6 17 -32 15 -39 -3z"/>
<path d="M680 265 c0 -20 4 -26 18 -23 9 2 17 12 17 23 0 11 -8 21 -17 23 -14
3 -18 -3 -18 -23z"/>
<path d="M353 263 c-18 -6 -16 -50 1 -56 8 -3 22 1 33 8 28 21 -1 62 -34 48z"/>
<path d="M580 250 c0 -13 7 -20 20 -20 13 0 20 7 20 20 0 13 -7 20 -20 20 -13
0 -20 -7 -20 -20z"/>
<path d="M812 258 c-16 -16 -15 -33 4 -48 22 -19 54 12 38 37 -14 22 -27 26
-42 11z"/>
<path d="M454 206 c-10 -26 4 -48 28 -44 17 2 23 10 23 28 0 18 -6 26 -23 28
-13 2 -25 -3 -28 -12z"/>
<path d="M694 206 c-10 -26 4 -48 28 -44 17 2 23 10 23 28 0 18 -6 26 -23 28
-13 2 -25 -3 -28 -12z"/>
<path d="M574 185 c-4 -9 0 -23 8 -31 20 -20 50 -7 46 20 -4 26 -45 35 -54 11z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.6 KiB

@@ -817,6 +817,7 @@ const driverProfiles: Record<
questdb: { type: "questdb", port: 8812, user: "questdb", label: "QuestDB", icon: "questdb" }, questdb: { type: "questdb", port: 8812, user: "questdb", label: "QuestDB", icon: "questdb" },
kingbase: { type: "kingbase", port: 54321, user: "system", label: "KingBase", icon: "kingbase" }, kingbase: { type: "kingbase", port: 54321, user: "system", label: "KingBase", icon: "kingbase" },
highgo: { type: "highgo", port: 5866, user: "highgo", label: "瀚高 HighGo", icon: "highgo" }, highgo: { type: "highgo", port: 5866, user: "highgo", label: "瀚高 HighGo", icon: "highgo" },
uxdb: { type: "uxdb", port: 52025, user: "uxdb", label: "优炫 UXDB", icon: "uxdb" },
yashandb: { type: "yashandb", port: 1688, user: "sys", label: "崖山 YashanDB", icon: "yashandb" }, yashandb: { type: "yashandb", port: 1688, user: "sys", label: "崖山 YashanDB", icon: "yashandb" },
vastbase: { type: "vastbase", port: 5432, user: "vastbase", label: "Vastbase", icon: "vastbase" }, vastbase: { type: "vastbase", port: 5432, user: "vastbase", label: "Vastbase", icon: "vastbase" },
doris: { type: "mysql", port: 9030, user: "root", label: "Doris", icon: "doris", urlParams: "" }, doris: { type: "mysql", port: 9030, user: "root", label: "Doris", icon: "doris", urlParams: "" },
@@ -2077,6 +2078,7 @@ function defaultDatabaseForProfile() {
if (form.value.db_type === "databend") return "default"; if (form.value.db_type === "databend") return "default";
if (selectedType.value === "cockroachdb") return "defaultdb"; if (selectedType.value === "cockroachdb") return "defaultdb";
if (form.value.db_type === "highgo") return "highgo"; if (form.value.db_type === "highgo") return "highgo";
if (form.value.db_type === "uxdb") return "uxdb";
if (form.value.db_type === "yashandb") return "yasdb"; if (form.value.db_type === "yashandb") return "yasdb";
if (form.value.db_type === "postgres" || form.value.db_type === "vastbase") return "postgres"; if (form.value.db_type === "postgres" || form.value.db_type === "vastbase") return "postgres";
if (form.value.db_type === "sqlserver") return "master"; if (form.value.db_type === "sqlserver") return "master";
@@ -2155,6 +2157,7 @@ const iconTypeMap: Record<string, string> = {
questdb: "questdb", questdb: "questdb",
kingbase: "kingbase", kingbase: "kingbase",
highgo: "highgo", highgo: "highgo",
uxdb: "uxdb",
yashandb: "yashandb", yashandb: "yashandb",
vastbase: "vastbase", vastbase: "vastbase",
doris: "doris", doris: "doris",
@@ -1,11 +1,13 @@
<script setup lang="ts"> <script setup lang="ts">
import { computed } from "vue"; import { computed } from "vue";
import { Database } from "@lucide/vue"; import { Database } from "@lucide/vue";
import { useTheme } from "@/composables/useTheme";
import { webPath } from "@/lib/common/webPath"; import { webPath } from "@/lib/common/webPath";
const props = defineProps<{ const props = defineProps<{
dbType: string; dbType: string;
}>(); }>();
const { isDark } = useTheme();
const assetIcons: Record<string, string> = { const assetIcons: Record<string, string> = {
mysql: "mysql", mysql: "mysql",
@@ -38,6 +40,7 @@ const assetIcons: Record<string, string> = {
kwdb: "kwdb", kwdb: "kwdb",
kingbase: "kingbase", kingbase: "kingbase",
highgo: "highgo.png", highgo: "highgo.png",
uxdb: "uxdb",
goldendb: "goldendb.png", goldendb: "goldendb.png",
databend: "databend", databend: "databend",
vastbase: "vastbase.png", vastbase: "vastbase.png",
@@ -106,6 +109,7 @@ const normalizedType = computed(() => props.dbType.toLowerCase().replace(/[\s-]+
const assetName = computed(() => assetIcons[normalizedType.value]); const assetName = computed(() => assetIcons[normalizedType.value]);
const assetSrc = computed(() => { const assetSrc = computed(() => {
if (!assetName.value) return ""; if (!assetName.value) return "";
if (normalizedType.value === "uxdb" && isDark.value) return webPath("/icons/database/uxdb-dark.svg");
return webPath(assetName.value.includes(".") ? `/icons/database/${assetName.value}` : `/icons/database/${assetName.value}.svg`); return webPath(assetName.value.includes(".") ? `/icons/database/${assetName.value}` : `/icons/database/${assetName.value}.svg`);
}); });
const letter = computed(() => letterIcons[normalizedType.value]); const letter = computed(() => letterIcons[normalizedType.value]);
@@ -683,7 +683,7 @@ const defaultValuePresets = computed((): DefaultValuePreset[] => {
}); });
function isPostgresIdentityType(dbType: string | undefined): boolean { function isPostgresIdentityType(dbType: string | undefined): boolean {
return dbType === "postgres" || dbType === "gaussdb" || dbType === "kwdb" || dbType === "opengauss" || dbType === "highgo" || dbType === "vastbase" || dbType === "kingbase"; return dbType === "postgres" || dbType === "gaussdb" || dbType === "kwdb" || dbType === "opengauss" || dbType === "highgo" || dbType === "uxdb" || dbType === "vastbase" || dbType === "kingbase";
} }
const showExtendedProperties = computed(() => { const showExtendedProperties = computed(() => {
@@ -10,6 +10,7 @@ const DRIVER_STARTUP_FLOOR_TYPES = new Set<DatabaseType>([
"dameng", "dameng",
"kingbase", "kingbase",
"highgo", "highgo",
"uxdb",
"vastbase", "vastbase",
"goldendb", "goldendb",
"yashandb", "yashandb",
@@ -10,6 +10,7 @@ export const SCHEMA_AWARE_TYPES = new Set<DatabaseType>([
"kwdb", "kwdb",
"kingbase", "kingbase",
"highgo", "highgo",
"uxdb",
"vastbase", "vastbase",
"yashandb", "yashandb",
"databricks", "databricks",
@@ -57,6 +58,7 @@ export const TREE_SCHEMA_TYPES = new Set<DatabaseType>([
"kwdb", "kwdb",
"kingbase", "kingbase",
"highgo", "highgo",
"uxdb",
"vastbase", "vastbase",
"yashandb", "yashandb",
"databricks", "databricks",
@@ -41,6 +41,7 @@ export const DATABASE_NAMESPACE_CREATION_MATRIX = {
gaussdb: { connection: "database", database: "schema" }, gaussdb: { connection: "database", database: "schema" },
kingbase: { connection: "database", database: "schema" }, kingbase: { connection: "database", database: "schema" },
highgo: { connection: "database", database: "schema" }, highgo: { connection: "database", database: "schema" },
uxdb: { database: "schema" },
vastbase: { connection: "database", database: "schema" }, vastbase: { connection: "database", database: "schema" },
goldendb: { connection: "database" }, goldendb: { connection: "database" },
kwdb: { connection: "database", database: "schema" }, kwdb: { connection: "database", database: "schema" },
@@ -26,6 +26,7 @@ const DATABASE_TYPE_OBJECTS = new Map<DatabaseType, SidebarObjectKind[]>([
// postgres like // postgres like
["kingbase", POSTGRES_LIKE_OBJECTS], ["kingbase", POSTGRES_LIKE_OBJECTS],
["highgo", POSTGRES_LIKE_OBJECTS], ["highgo", POSTGRES_LIKE_OBJECTS],
["uxdb", POSTGRES_LIKE_OBJECTS],
["vastbase", POSTGRES_LIKE_OBJECTS], ["vastbase", POSTGRES_LIKE_OBJECTS],
["redshift", POSTGRES_LIKE_OBJECTS], ["redshift", POSTGRES_LIKE_OBJECTS],
// oracle // oracle
@@ -13,7 +13,7 @@ type PropertyEditConnection = Pick<ConnectionConfig, "db_type" | "driver_profile
type DatabaseNode = Pick<{ type: TreeNodeType; database?: string | null }, "type" | "database">; type DatabaseNode = Pick<{ type: TreeNodeType; database?: string | null }, "type" | "database">;
type SchemaNode = Pick<{ type: TreeNodeType; database?: string | null; schema?: string | null }, "type" | "database" | "schema">; 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 = { export const DATABASE_PROPERTY_EDITING_MATRIX = {
mysql: { database: ["charsetCollation"] }, mysql: { database: ["charsetCollation"] },
@@ -42,6 +42,7 @@ export const DATABASE_PROPERTY_EDITING_MATRIX = {
gaussdb: { database: ["databaseComment"], schema: ["schemaComment"] }, gaussdb: { database: ["databaseComment"], schema: ["schemaComment"] },
kingbase: { database: ["databaseComment"], schema: ["schemaComment"] }, kingbase: { database: ["databaseComment"], schema: ["schemaComment"] },
highgo: { database: ["databaseComment"], schema: ["schemaComment"] }, highgo: { database: ["databaseComment"], schema: ["schemaComment"] },
uxdb: { database: ["databaseComment"], schema: ["schemaComment"] },
vastbase: { database: ["databaseComment"], schema: ["schemaComment"] }, vastbase: { database: ["databaseComment"], schema: ["schemaComment"] },
goldendb: { database: ["charsetCollation"] }, goldendb: { database: ["charsetCollation"] },
kwdb: { database: ["databaseComment"], schema: ["schemaComment"] }, kwdb: { database: ["databaseComment"], schema: ["schemaComment"] },
@@ -64,6 +64,7 @@ const NAVICAT_STYLE_TABLE_DATA_TYPES = new Set<DatabaseType>([
"kwdb", "kwdb",
"kingbase", "kingbase",
"highgo", "highgo",
"uxdb",
"vastbase", "vastbase",
"goldendb", "goldendb",
"yashandb", "yashandb",
+3 -3
View File
@@ -87,8 +87,8 @@ export function buildTruncateTableSql(options: TableAdminSqlOptions): Promise<st
return api.buildTruncateTableSql(options); return api.buildTruncateTableSql(options);
} }
const DROP_TABLE_CASCADE_DATABASE_TYPES: readonly DatabaseType[] = ["postgres", "redshift", "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", "vastbase", "opengauss"]; const TRUNCATE_TABLE_CASCADE_DATABASE_TYPES: readonly DatabaseType[] = ["postgres", "gaussdb", "kwdb", "kingbase", "highgo", "uxdb", "vastbase", "opengauss"];
export function supportsDropTableCascade(databaseType?: DatabaseType): boolean { export function supportsDropTableCascade(databaseType?: DatabaseType): boolean {
return !!databaseType && DROP_TABLE_CASCADE_DATABASE_TYPES.includes(databaseType); 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 { 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> { export function buildUpdateDatabasePropertiesSql(options: DatabasePropertyEditSqlOptions): Promise<string> {
@@ -42,6 +42,7 @@ const SCHEMA_FIRST_QUALIFIER_TYPES = new Set<DatabaseType>([
"opengauss", "opengauss",
"kingbase", "kingbase",
"highgo", "highgo",
"uxdb",
"vastbase", "vastbase",
"yashandb", "yashandb",
"oracle", "oracle",
@@ -14,6 +14,7 @@ const SYSTEM_DATABASE_RULES: Partial<Record<DatabaseType, ReadonlySet<string>>>
questdb: new Set(["template0", "template1"]), questdb: new Set(["template0", "template1"]),
kingbase: new Set(["template0", "template1"]), kingbase: new Set(["template0", "template1"]),
highgo: new Set(["template0", "template1"]), highgo: new Set(["template0", "template1"]),
uxdb: new Set(["template0", "template1"]),
vastbase: new Set(["template0", "template1"]), vastbase: new Set(["template0", "template1"]),
redshift: new Set(["template0", "template1"]), redshift: new Set(["template0", "template1"]),
clickhouse: new Set(["information_schema", "system"]), 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">; 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 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 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"]); 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 "opengauss":
case "gaussdb": case "gaussdb":
case "highgo": case "highgo":
case "uxdb":
return SQL_SEMANTIC_DIALECTS.postgres; return SQL_SEMANTIC_DIALECTS.postgres;
case "mysql": case "mysql":
case "doris": case "doris":
+1 -1
View File
@@ -48,7 +48,7 @@ export interface EditableQuerySource {
alias?: string; 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"]); 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 "questdb":
case "kingbase": case "kingbase":
case "highgo": case "highgo":
case "uxdb":
case "vastbase": case "vastbase":
case "redshift": case "redshift":
return "postgres"; return "postgres";
@@ -11,7 +11,7 @@ export interface BuildRenameObjectSqlOptions {
newName: string; 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"]); const oracleLikeRenameTypes = new Set<DatabaseType>(["oracle", "dameng"]);
@@ -15,8 +15,8 @@ export type BuildRoutineRenameObjectSourceInput = BuildEditableObjectSourceSqlIn
export type ObjectSourceSaveExecutionMode = "single" | "script"; export type ObjectSourceSaveExecutionMode = "single" | "script";
const postgresLikeRoutineRenameTypes = new Set<DatabaseType>(["postgres", "redshift", "gaussdb", "kwdb", "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", "vastbase"]); const postgresLikeViewTypes = new Set<DatabaseType>(["postgres", "redshift", "gaussdb", "kwdb", "opengauss", "questdb", "kingbase", "highgo", "uxdb", "vastbase"]);
const mysqlLikeRoutineRenameTypes = new Set<DatabaseType>(["mysql", "goldendb"]); const mysqlLikeRoutineRenameTypes = new Set<DatabaseType>(["mysql", "goldendb"]);
const oracleLikeRoutineRenameTypes = new Set<DatabaseType>(["oracle", "dameng"]); 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"; if (databaseType === "clickhouse") return "Int64";
return "BIGINT"; return "BIGINT";
case "decimal": 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 === "sqlite" || databaseType === "rqlite" || databaseType === "turso" || databaseType === "cloudflare-d1") return "REAL";
if (databaseType === "oracle" || databaseType === "oceanbase-oracle" || databaseType === "dameng") return "BINARY_DOUBLE"; if (databaseType === "oracle" || databaseType === "oceanbase-oracle" || databaseType === "dameng") return "BINARY_DOUBLE";
if (databaseType === "clickhouse") return "Float64"; if (databaseType === "clickhouse") return "Float64";
@@ -254,7 +254,7 @@ export function importDataTypeForDatabase(inferredType: ImportInferredType, data
if (databaseType === "clickhouse") return "DateTime64"; if (databaseType === "clickhouse") return "DateTime64";
return "TIMESTAMP"; return "TIMESTAMP";
case "json": 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"; if (databaseType === "mysql" || databaseType === "databend") return "JSON";
return importDataTypeForDatabase("text", databaseType); return importDataTypeForDatabase("text", databaseType);
case "text": case "text":
@@ -313,6 +313,7 @@ const capabilityByType: Partial<Record<DatabaseType, TableStructureCapabilities>
redshift: redshiftCapabilities, redshift: redshiftCapabilities,
vertica: redshiftCapabilities, vertica: redshiftCapabilities,
highgo: postgresCapabilities, highgo: postgresCapabilities,
uxdb: postgresCapabilities,
vastbase: postgresCapabilities, vastbase: postgresCapabilities,
kingbase: postgresCapabilities, kingbase: postgresCapabilities,
firebird: firebirdCapabilities, firebird: firebirdCapabilities,
@@ -288,6 +288,7 @@ const DATA_TYPE_OPTION_ALIASES: Partial<Record<DatabaseType, string>> = {
questdb: "questdb", questdb: "questdb",
redshift: "postgres", redshift: "postgres",
highgo: "postgres", highgo: "postgres",
uxdb: "postgres",
vastbase: "postgres", vastbase: "postgres",
kingbase: "postgres", kingbase: "postgres",
dameng: "oracle", dameng: "oracle",
@@ -466,7 +467,7 @@ export function parseExtraToColumnExtra(extra: string | null | undefined, databa
if (lower.includes("on update current_timestamp")) { if (lower.includes("on update current_timestamp")) {
result.onUpdateCurrentTimestamp = true; 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); const identityMatch = lower.match(/generated\s+(by\s+default|always)\s+as\s+identity/i);
if (identityMatch) { if (identityMatch) {
const sequenceMatch = lower.match(/start\s+with\s*(-?\d+)\s+increment\s+by\s*(-?\d+)/i); 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 "kwdb":
case "opengauss": case "opengauss":
case "highgo": case "highgo":
case "uxdb":
case "vastbase": case "vastbase":
case "kingbase": case "kingbase":
case "redshift": case "redshift":
@@ -1109,7 +1111,7 @@ export function isDataTypeLengthDisabled(_dbType: DatabaseType | undefined, base
return key !== "geohash" && key !== "decimal"; return key !== "geohash" && key !== "decimal";
} else if (_dbType === "manticoresearch") { } else if (_dbType === "manticoresearch") {
return key !== "bit" && key !== "float_vector"; 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); return POSTGRES_TYPE_LENGTH_DISABLES.includes(key);
} else if (isOracleLikeStructureType(_dbType)) { } else if (isOracleLikeStructureType(_dbType)) {
// Dameng/Oracle integer aliases have fixed precision; MySQL-style display widths generate invalid DDL. // Dameng/Oracle integer aliases have fixed precision; MySQL-style display widths generate invalid DDL.
+4 -1
View File
@@ -898,6 +898,7 @@ export const useConnectionStore = defineStore("connection", () => {
kwdb: "KWDB", kwdb: "KWDB",
kingbase: "KingBase", kingbase: "KingBase",
highgo: "瀚高 HighGo", highgo: "瀚高 HighGo",
uxdb: "优炫 UXDB",
yashandb: "崖山 YashanDB", yashandb: "崖山 YashanDB",
vastbase: "Vastbase", vastbase: "Vastbase",
goldendb: "GoldenDB", goldendb: "GoldenDB",
@@ -933,6 +934,8 @@ export const useConnectionStore = defineStore("connection", () => {
dbType = "kingbase" as ConnectionConfig["db_type"]; dbType = "kingbase" as ConnectionConfig["db_type"];
} else if (profile === "highgo" && dbType === "postgres") { } else if (profile === "highgo" && dbType === "postgres") {
dbType = "highgo" as ConnectionConfig["db_type"]; dbType = "highgo" as ConnectionConfig["db_type"];
} else if (profile === "uxdb" && dbType === "postgres") {
dbType = "uxdb" as ConnectionConfig["db_type"];
} else if (profile === "vastbase" && dbType === "postgres") { } else if (profile === "vastbase" && dbType === "postgres") {
dbType = "vastbase" as ConnectionConfig["db_type"]; dbType = "vastbase" as ConnectionConfig["db_type"];
} else if (profile === "goldendb" && dbType === "mysql") { } else if (profile === "goldendb" && dbType === "mysql") {
@@ -4354,7 +4357,7 @@ export const useConnectionStore = defineStore("connection", () => {
} }
function isPostgresLikeForExtensions(dbType?: string): boolean { function isPostgresLikeForExtensions(dbType?: string): boolean {
return dbType === "postgres" || dbType === "gaussdb" || dbType === "kwdb" || dbType === "opengauss" || dbType === "highgo" || dbType === "vastbase" || dbType === "kingbase"; return dbType === "postgres" || dbType === "gaussdb" || dbType === "kwdb" || dbType === "opengauss" || dbType === "highgo" || dbType === "uxdb" || dbType === "vastbase" || dbType === "kingbase";
} }
function metadataQuerySchema(connectionId: string, database: string, schema?: string): string { function metadataQuerySchema(connectionId: string, database: string, schema?: string): string {
+1
View File
@@ -25,6 +25,7 @@ export type DatabaseType =
| "gaussdb" | "gaussdb"
| "kingbase" | "kingbase"
| "highgo" | "highgo"
| "uxdb"
| "vastbase" | "vastbase"
| "goldendb" | "goldendb"
| "kwdb" | "kwdb"
+1
View File
@@ -33,6 +33,7 @@ const BRIDGE_REQUIRED_TYPES: &[&str] = &[
"dameng", "dameng",
"kingbase", "kingbase",
"highgo", "highgo",
"uxdb",
"vastbase", "vastbase",
"goldendb", "goldendb",
"databend", "databend",
@@ -677,6 +677,36 @@
"driverManagement": true "driverManagement": true
} }
}, },
{
"dbType": "uxdb",
"label": "优炫 UXDB",
"runtimeMode": "agent",
"mcpMode": "bridge",
"agentKey": "uxdb",
"singleConnectionPool": true,
"metadataConnectionScoped": false,
"skipTcpProbe": true,
"defaultPort": 52025,
"supportLevel": "operate",
"capabilities": {
"queryExecution": true,
"metadataBrowse": true,
"objectBrowser": true,
"objectSource": true,
"schemaSearch": true,
"diagram": true,
"tableDataEdit": true,
"tableStructureEdit": true,
"tableImport": true,
"dataTransfer": false,
"sqlFileExecution": true,
"databaseCreate": false,
"fieldLineage": false,
"sqlExplain": false,
"userAdmin": false,
"driverManagement": true
}
},
{ {
"dbType": "vastbase", "dbType": "vastbase",
"label": "Vastbase", "label": "Vastbase",
+7
View File
@@ -74,6 +74,13 @@ const AGENT_CATALOG: &[AgentCatalogEntry] = &[
store_visible: true, store_visible: true,
profiles: &[], profiles: &[],
}, },
AgentCatalogEntry {
db_type: DatabaseType::Uxdb,
key: "uxdb",
label: "优炫 UXDB",
store_visible: true,
profiles: &[],
},
AgentCatalogEntry { AgentCatalogEntry {
db_type: DatabaseType::Vastbase, db_type: DatabaseType::Vastbase,
key: "vastbase", key: "vastbase",
+19 -2
View File
@@ -12,7 +12,10 @@ pub fn agent_connect_params(config: &ConnectionConfig, host: &str, port: u16, da
mongo_agent_database(config, database) mongo_agent_database(config, database)
} else if matches!(config.db_type, DatabaseType::Oracle | DatabaseType::OceanbaseOracle) { } else if matches!(config.db_type, DatabaseType::Oracle | DatabaseType::OceanbaseOracle) {
oracle_agent_database(config, database) oracle_agent_database(config, database)
} else if matches!(config.db_type, DatabaseType::Kingbase | DatabaseType::Highgo | DatabaseType::Vastbase) { } else if matches!(
config.db_type,
DatabaseType::Kingbase | DatabaseType::Highgo | DatabaseType::Uxdb | DatabaseType::Vastbase
) {
postgres_like_agent_database(config, database).to_string() postgres_like_agent_database(config, database).to_string()
} else if is_h2_file_connection(config) { } else if is_h2_file_connection(config) {
h2_agent_database(config) h2_agent_database(config)
@@ -25,7 +28,10 @@ pub fn agent_connect_params(config: &ConnectionConfig, host: &str, port: u16, da
oracle_jdbc_connection_string(config, host, port, database) oracle_jdbc_connection_string(config, host, port, database)
} else if config.db_type == DatabaseType::OceanbaseOracle { } else if config.db_type == DatabaseType::OceanbaseOracle {
oceanbase_oracle_jdbc_connection_string(config, host, port, database) oceanbase_oracle_jdbc_connection_string(config, host, port, database)
} else if matches!(config.db_type, DatabaseType::Kingbase | DatabaseType::Highgo | DatabaseType::Vastbase) { } else if matches!(
config.db_type,
DatabaseType::Kingbase | DatabaseType::Highgo | DatabaseType::Uxdb | DatabaseType::Vastbase
) {
postgres_like_agent_jdbc_connection_string(config, host, port, database) postgres_like_agent_jdbc_connection_string(config, host, port, database)
} else if config.db_type == DatabaseType::SapHana { } else if config.db_type == DatabaseType::SapHana {
sap_hana_jdbc_connection_string(config, host, port, database) sap_hana_jdbc_connection_string(config, host, port, database)
@@ -408,6 +414,7 @@ fn postgres_like_agent_jdbc_connection_string(
let scheme = match config.db_type { let scheme = match config.db_type {
DatabaseType::Kingbase => "kingbase8", DatabaseType::Kingbase => "kingbase8",
DatabaseType::Highgo => "highgo", DatabaseType::Highgo => "highgo",
DatabaseType::Uxdb => "uxdb",
DatabaseType::Vastbase => "vastbase", DatabaseType::Vastbase => "vastbase",
_ => unreachable!("postgres-like agent JDBC URL requested for {:?}", config.db_type), _ => unreachable!("postgres-like agent JDBC URL requested for {:?}", config.db_type),
}; };
@@ -727,6 +734,16 @@ mod tests {
assert_eq!(params["connection_string"], "jdbc:vastbase://vastbase.example.com:5432/postgres"); assert_eq!(params["connection_string"], "jdbc:vastbase://vastbase.example.com:5432/postgres");
} }
#[test]
fn uxdb_agent_params_use_vendor_jdbc_url() {
let cfg = config(DatabaseType::Uxdb, Some("uxdb"));
let params = agent_connect_params(&cfg, "uxdb.example.com", 52025, "uxdb");
assert_eq!(params["database"], "uxdb");
assert_eq!(params["connection_string"], "jdbc:uxdb://uxdb.example.com:52025/uxdb");
}
#[test] #[test]
fn zookeeper_agent_params_preserve_configured_connect_string() { fn zookeeper_agent_params_preserve_configured_connect_string() {
let mut cfg = config(DatabaseType::ZooKeeper, None); let mut cfg = config(DatabaseType::ZooKeeper, None);
+5
View File
@@ -139,6 +139,7 @@ macro_rules! agent_connection_pool_database_type {
DatabaseType::Dameng DatabaseType::Dameng
| DatabaseType::Kingbase | DatabaseType::Kingbase
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Vastbase | DatabaseType::Vastbase
| DatabaseType::Goldendb | DatabaseType::Goldendb
| DatabaseType::Databend | DatabaseType::Databend
@@ -4978,6 +4979,10 @@ mod tests {
config.db_type = DatabaseType::Sqlite; config.db_type = DatabaseType::Sqlite;
config.host = db_path.to_string_lossy().to_string(); config.host = db_path.to_string_lossy().to_string();
config.port = 0; config.port = 0;
// This exercises a plain SQLite file. The shared MySQL fixture carries
// credentials, and a SQLite password intentionally opts into SQLCipher.
config.username.clear();
config.password.clear();
state.configs.write().await.insert(config.id.clone(), config); state.configs.write().await.insert(config.id.clone(), config);
+2
View File
@@ -2716,6 +2716,7 @@ fn is_postgres_like_pattern_database(database_type: Option<DatabaseType>) -> boo
| DatabaseType::Kwdb | DatabaseType::Kwdb
| DatabaseType::Kingbase | DatabaseType::Kingbase
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Vastbase | DatabaseType::Vastbase
| DatabaseType::OpenGauss | DatabaseType::OpenGauss
) )
@@ -2829,6 +2830,7 @@ fn uses_keyless_row_predicate(database_type: Option<DatabaseType>) -> bool {
| DatabaseType::Kwdb | DatabaseType::Kwdb
| DatabaseType::Kingbase | DatabaseType::Kingbase
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Vastbase | DatabaseType::Vastbase
| DatabaseType::Goldendb | DatabaseType::Goldendb
| DatabaseType::Yashandb | DatabaseType::Yashandb
@@ -22,6 +22,7 @@ pub fn is_single_connection_pool(db_type: &DatabaseType) -> bool {
| DatabaseType::Dameng | DatabaseType::Dameng
| DatabaseType::Kingbase | DatabaseType::Kingbase
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Vastbase | DatabaseType::Vastbase
| DatabaseType::Goldendb | DatabaseType::Goldendb
| DatabaseType::Yashandb | DatabaseType::Yashandb
+7
View File
@@ -258,6 +258,7 @@ pub fn supports_create_schema_target(database_type: Option<DatabaseType>) -> boo
| DatabaseType::Kwdb | DatabaseType::Kwdb
| DatabaseType::Kingbase | DatabaseType::Kingbase
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Vastbase | DatabaseType::Vastbase
| DatabaseType::Yashandb | DatabaseType::Yashandb
| DatabaseType::Dameng | DatabaseType::Dameng
@@ -294,6 +295,7 @@ pub fn supports_database_property_comment(database_type: Option<DatabaseType>) -
| DatabaseType::Kwdb | DatabaseType::Kwdb
| DatabaseType::Kingbase | DatabaseType::Kingbase
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Vastbase | DatabaseType::Vastbase
| DatabaseType::OpenGauss | DatabaseType::OpenGauss
| DatabaseType::Yashandb | DatabaseType::Yashandb
@@ -369,6 +371,7 @@ fn supports_drop_table_cascade(database_type: Option<DatabaseType>) -> bool {
| DatabaseType::Kwdb | DatabaseType::Kwdb
| DatabaseType::Kingbase | DatabaseType::Kingbase
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Vastbase | DatabaseType::Vastbase
| DatabaseType::OpenGauss | DatabaseType::OpenGauss
) )
@@ -397,6 +400,7 @@ pub fn build_drop_table_child_object_sql(options: DropTableChildObjectSqlOptions
| DatabaseType::OpenGauss | DatabaseType::OpenGauss
| DatabaseType::Questdb | DatabaseType::Questdb
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Vastbase | DatabaseType::Vastbase
| DatabaseType::Kingbase | DatabaseType::Kingbase
| DatabaseType::Oracle | DatabaseType::Oracle
@@ -429,6 +433,7 @@ pub fn build_drop_table_child_object_sql(options: DropTableChildObjectSqlOptions
| DatabaseType::OpenGauss | DatabaseType::OpenGauss
| DatabaseType::Questdb | DatabaseType::Questdb
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Vastbase | DatabaseType::Vastbase
| DatabaseType::Kingbase | DatabaseType::Kingbase
) )
@@ -488,6 +493,7 @@ fn supports_truncate_table_cascade(database_type: Option<DatabaseType>) -> bool
| DatabaseType::Kwdb | DatabaseType::Kwdb
| DatabaseType::Kingbase | DatabaseType::Kingbase
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Vastbase | DatabaseType::Vastbase
| DatabaseType::OpenGauss | DatabaseType::OpenGauss
) )
@@ -706,6 +712,7 @@ fn is_postgres_like_rename(database_type: DatabaseType) -> bool {
| DatabaseType::Kwdb | DatabaseType::Kwdb
| DatabaseType::Kingbase | DatabaseType::Kingbase
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Vastbase | DatabaseType::Vastbase
) )
} }
+15
View File
@@ -468,6 +468,7 @@ pub enum DatabaseType {
Dameng, Dameng,
Kingbase, Kingbase,
Highgo, Highgo,
Uxdb,
Vastbase, Vastbase,
Goldendb, Goldendb,
Gaussdb, Gaussdb,
@@ -852,6 +853,7 @@ impl ConnectionConfig {
DatabaseType::Kwdb => Some("defaultdb"), DatabaseType::Kwdb => Some("defaultdb"),
DatabaseType::Vastbase => Some("postgres"), DatabaseType::Vastbase => Some("postgres"),
DatabaseType::Highgo => Some("highgo"), DatabaseType::Highgo => Some("highgo"),
DatabaseType::Uxdb => Some("uxdb"),
DatabaseType::Yashandb => Some("yasdb"), DatabaseType::Yashandb => Some("yasdb"),
DatabaseType::Oscar => Some("osrdb"), DatabaseType::Oscar => Some("osrdb"),
DatabaseType::Firebird => Some("employee"), DatabaseType::Firebird => Some("employee"),
@@ -994,6 +996,7 @@ impl ConnectionConfig {
DatabaseType::Dameng => format!("dm://{host}:{port}{db_part}"), DatabaseType::Dameng => format!("dm://{host}:{port}{db_part}"),
DatabaseType::Kingbase => format!("kingbase://{host}:{port}{db_part}"), DatabaseType::Kingbase => format!("kingbase://{host}:{port}{db_part}"),
DatabaseType::Highgo => format!("highgo://{host}:{port}{db_part}"), DatabaseType::Highgo => format!("highgo://{host}:{port}{db_part}"),
DatabaseType::Uxdb => format!("uxdb://{host}:{port}{db_part}"),
DatabaseType::Vastbase => format!("vastbase://{host}:{port}{db_part}"), DatabaseType::Vastbase => format!("vastbase://{host}:{port}{db_part}"),
DatabaseType::Goldendb => format!("goldendb://{host}:{port}{db_part}"), DatabaseType::Goldendb => format!("goldendb://{host}:{port}{db_part}"),
DatabaseType::Gaussdb => format!("gaussdb://{host}:{port}{db_part}"), DatabaseType::Gaussdb => format!("gaussdb://{host}:{port}{db_part}"),
@@ -1147,6 +1150,9 @@ impl ConnectionConfig {
DatabaseType::Highgo => { DatabaseType::Highgo => {
format!("highgo://{}:{}@{host}:{port}{db_part}", username, password) format!("highgo://{}:{}@{host}:{port}{db_part}", username, password)
} }
DatabaseType::Uxdb => {
format!("uxdb://{}:{}@{host}:{port}{db_part}", username, password)
}
DatabaseType::Vastbase => { DatabaseType::Vastbase => {
format!("vastbase://{}:{}@{host}:{port}{db_part}", username, password) format!("vastbase://{}:{}@{host}:{port}{db_part}", username, password)
} }
@@ -2544,6 +2550,15 @@ mod tests {
assert_eq!(config.connection_url(), "vastbase://vastbase:secret@10.1.2.3:5432/postgres"); assert_eq!(config.connection_url(), "vastbase://vastbase:secret@10.1.2.3:5432/postgres");
} }
#[test]
fn uxdb_connection_url_uses_uxdb_scheme() {
let mut config = mysql_config("uxdb", "secret", Some("warehouse"));
config.db_type = DatabaseType::Uxdb;
config.port = 52025;
assert_eq!(config.connection_url(), "uxdb://uxdb:secret@10.1.2.3:52025/warehouse");
}
#[test] #[test]
fn clickhouse_tls_uses_https_from_ssl_or_secure_param() { fn clickhouse_tls_uses_https_from_ssl_or_secure_param() {
let mut config = mysql_config("default", "", None); let mut config = mysql_config("default", "", None);
+1
View File
@@ -302,6 +302,7 @@ fn is_postgres_like(database_type: DatabaseType) -> bool {
| DatabaseType::Questdb | DatabaseType::Questdb
| DatabaseType::Kingbase | DatabaseType::Kingbase
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Vastbase | DatabaseType::Vastbase
) )
} }
+1
View File
@@ -402,6 +402,7 @@ fn schema_first_qualifier_type(db_type: &DatabaseType) -> bool {
| DatabaseType::OpenGauss | DatabaseType::OpenGauss
| DatabaseType::Kingbase | DatabaseType::Kingbase
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Vastbase | DatabaseType::Vastbase
| DatabaseType::Yashandb | DatabaseType::Yashandb
| DatabaseType::Oracle | DatabaseType::Oracle
@@ -258,6 +258,7 @@ fn is_postgresql_family_database(database_type: DatabaseType) -> bool {
| DatabaseType::OpenGauss | DatabaseType::OpenGauss
| DatabaseType::Kingbase | DatabaseType::Kingbase
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Vastbase | DatabaseType::Vastbase
| DatabaseType::Kwdb | DatabaseType::Kwdb
) )
+5 -2
View File
@@ -3437,6 +3437,7 @@ mod tests {
assert!(!is_agent_postgres_metadata_fallback_config(&test_connection_config(DatabaseType::Kingbase))); assert!(!is_agent_postgres_metadata_fallback_config(&test_connection_config(DatabaseType::Kingbase)));
assert!(is_agent_postgres_metadata_fallback_config(&test_connection_config(DatabaseType::Highgo))); assert!(is_agent_postgres_metadata_fallback_config(&test_connection_config(DatabaseType::Highgo)));
assert!(is_agent_postgres_metadata_fallback_config(&test_connection_config(DatabaseType::Vastbase))); assert!(is_agent_postgres_metadata_fallback_config(&test_connection_config(DatabaseType::Vastbase)));
assert!(!is_agent_postgres_metadata_fallback_config(&test_connection_config(DatabaseType::Uxdb)));
assert!(!is_agent_postgres_metadata_fallback_config(&test_connection_config(DatabaseType::Postgres))); assert!(!is_agent_postgres_metadata_fallback_config(&test_connection_config(DatabaseType::Postgres)));
assert!(!is_agent_postgres_metadata_fallback_config(&test_connection_config(DatabaseType::Mysql))); assert!(!is_agent_postgres_metadata_fallback_config(&test_connection_config(DatabaseType::Mysql)));
} }
@@ -4535,8 +4536,9 @@ fn filter_completion_objects(objects: Vec<db::ObjectInfo>) -> Vec<db::ObjectInfo
} }
fn is_agent_postgres_metadata_fallback_config(config: &ConnectionConfig) -> bool { fn is_agent_postgres_metadata_fallback_config(config: &ConnectionConfig) -> bool {
// Kingbase has dedicated agent metadata SQL and may carry JDBC-specific URL // HighGo and Vastbase can use the native PostgreSQL metadata path when their
// parameters that the native PostgreSQL driver cannot parse. // agent returns no rows. UXDB is JDBC-only; opening a PostgreSQL fallback
// connection there turns valid empty schemas into misleading DB errors.
matches!(config.db_type, DatabaseType::Highgo | DatabaseType::Vastbase) matches!(config.db_type, DatabaseType::Highgo | DatabaseType::Vastbase)
} }
@@ -6038,6 +6040,7 @@ async fn get_object_source_once(
| DatabaseType::Questdb | DatabaseType::Questdb
| DatabaseType::Kingbase | DatabaseType::Kingbase
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Vastbase | DatabaseType::Vastbase
) )
}) { }) {
+1 -1
View File
@@ -199,7 +199,7 @@ fn normalize_clickhouse_join_order_for_parser(sql: &str) -> String {
fn normalize_dialect(dialect: Option<&str>) -> String { fn normalize_dialect(dialect: Option<&str>) -> String {
match dialect.unwrap_or("generic").to_ascii_lowercase().as_str() { match dialect.unwrap_or("generic").to_ascii_lowercase().as_str() {
"postgres" | "postgresql" | "redshift" | "opengauss" | "gaussdb" | "highgo" | "questdb" => { "postgres" | "postgresql" | "redshift" | "opengauss" | "gaussdb" | "highgo" | "uxdb" | "questdb" => {
"postgres".to_string() "postgres".to_string()
} }
"mysql" | "mariadb" | "doris" | "starrocks" | "manticoresearch" | "oceanbase" => "mysql".to_string(), "mysql" | "mariadb" | "doris" | "starrocks" | "manticoresearch" | "oceanbase" => "mysql".to_string(),
@@ -34,6 +34,7 @@ pub fn is_schema_aware(database_type: DatabaseType) -> bool {
| DatabaseType::Kwdb | DatabaseType::Kwdb
| DatabaseType::Kingbase | DatabaseType::Kingbase
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Vastbase | DatabaseType::Vastbase
| DatabaseType::Yashandb | DatabaseType::Yashandb
| DatabaseType::Oscar | DatabaseType::Oscar
+3 -2
View File
@@ -41,8 +41,8 @@ impl std::fmt::Display for SqlRisk {
/// Mirrors the logic in `sql_analysis::normalize_dialect`. /// Mirrors the logic in `sql_analysis::normalize_dialect`.
fn normalize_dialect(dialect: &str) -> &'static str { fn normalize_dialect(dialect: &str) -> &'static str {
match dialect.to_ascii_lowercase().as_str() { match dialect.to_ascii_lowercase().as_str() {
"postgres" | "postgresql" | "redshift" | "opengauss" | "gaussdb" | "kingbase" | "highgo" | "vastbase" "postgres" | "postgresql" | "redshift" | "opengauss" | "gaussdb" | "kingbase" | "highgo" | "uxdb"
| "kwdb" => "postgres", | "vastbase" | "kwdb" => "postgres",
"mysql" | "mariadb" | "doris" | "starrocks" | "manticoresearch" | "oceanbase" => "mysql", "mysql" | "mariadb" | "doris" | "starrocks" | "manticoresearch" | "oceanbase" => "mysql",
"sqlite" => "sqlite", "sqlite" => "sqlite",
"sqlserver" | "mssql" => "sqlserver", "sqlserver" | "mssql" => "sqlserver",
@@ -766,6 +766,7 @@ fn supports_select_into_table_creation(database_type: DatabaseType) -> bool {
| DatabaseType::OpenGauss | DatabaseType::OpenGauss
| DatabaseType::Kingbase | DatabaseType::Kingbase
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Vastbase | DatabaseType::Vastbase
| DatabaseType::Kwdb | DatabaseType::Kwdb
| DatabaseType::SqlServer | DatabaseType::SqlServer
+2
View File
@@ -3280,6 +3280,7 @@ fn decimal_data_type(db_type: &DatabaseType) -> &'static str {
| DatabaseType::Redshift | DatabaseType::Redshift
| DatabaseType::Kingbase | DatabaseType::Kingbase
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Kwdb | DatabaseType::Kwdb
| DatabaseType::Vastbase => "DOUBLE PRECISION", | DatabaseType::Vastbase => "DOUBLE PRECISION",
DatabaseType::Sqlite | DatabaseType::Rqlite | DatabaseType::Turso | DatabaseType::CloudflareD1 => "REAL", DatabaseType::Sqlite | DatabaseType::Rqlite | DatabaseType::Turso | DatabaseType::CloudflareD1 => "REAL",
@@ -3335,6 +3336,7 @@ fn json_data_type(db_type: &DatabaseType) -> &'static str {
| DatabaseType::OpenGauss | DatabaseType::OpenGauss
| DatabaseType::Kingbase | DatabaseType::Kingbase
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Kwdb | DatabaseType::Kwdb
| DatabaseType::Vastbase => "JSONB", | DatabaseType::Vastbase => "JSONB",
DatabaseType::Mysql | DatabaseType::Databend => "JSON", DatabaseType::Mysql | DatabaseType::Databend => "JSON",
@@ -111,6 +111,7 @@ pub(super) fn capabilities_for(database_type: Option<DatabaseType>) -> TableStru
| DatabaseType::Kwdb | DatabaseType::Kwdb
| DatabaseType::OpenGauss | DatabaseType::OpenGauss
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Vastbase | DatabaseType::Vastbase
| DatabaseType::Kingbase | DatabaseType::Kingbase
| DatabaseType::Firebird, | DatabaseType::Firebird,
+1
View File
@@ -501,6 +501,7 @@ fn is_postgres_family_target(target_db: &DatabaseType) -> bool {
| DatabaseType::Redshift | DatabaseType::Redshift
| DatabaseType::Kingbase | DatabaseType::Kingbase
| DatabaseType::Highgo | DatabaseType::Highgo
| DatabaseType::Uxdb
| DatabaseType::Kwdb | DatabaseType::Kwdb
| DatabaseType::Vastbase | DatabaseType::Vastbase
) )
@@ -112,6 +112,7 @@ fn maps_agent_database_types_to_driver_keys() {
assert_eq!(agent_key(&DatabaseType::Oracle, None), Some("oracle")); assert_eq!(agent_key(&DatabaseType::Oracle, None), Some("oracle"));
assert_eq!(agent_key(&DatabaseType::Databend, None), Some("databend")); assert_eq!(agent_key(&DatabaseType::Databend, None), Some("databend"));
assert_eq!(agent_key(&DatabaseType::InfluxDb, None), Some("influxdb")); assert_eq!(agent_key(&DatabaseType::InfluxDb, None), Some("influxdb"));
assert_eq!(agent_key(&DatabaseType::Uxdb, None), Some("uxdb"));
assert_eq!(agent_key(&DatabaseType::ZooKeeper, None), Some("zookeeper")); assert_eq!(agent_key(&DatabaseType::ZooKeeper, None), Some("zookeeper"));
assert_eq!(agent_key(&DatabaseType::Oracle, Some("oracle-legacy")), Some("oracle")); assert_eq!(agent_key(&DatabaseType::Oracle, Some("oracle-legacy")), Some("oracle"));
assert_eq!(agent_key(&DatabaseType::Oracle, Some("oracle-10g")), Some("oracle")); assert_eq!(agent_key(&DatabaseType::Oracle, Some("oracle-10g")), Some("oracle"));
@@ -326,6 +327,17 @@ fn driver_manifest_declares_expected_product_capabilities() {
assert!(zookeeper.capabilities.driver_management); assert!(zookeeper.capabilities.driver_management);
assert!(!zookeeper.capabilities.metadata_browse); assert!(!zookeeper.capabilities.metadata_browse);
let uxdb = find_driver(DatabaseType::Uxdb);
assert_eq!(uxdb.label, "优炫 UXDB");
assert_eq!(uxdb.runtime_mode, "agent");
assert_eq!(uxdb.agent_key.as_deref(), Some("uxdb"));
assert_eq!(uxdb.support_level, "operate");
assert!(uxdb.capabilities.query_execution);
assert!(uxdb.capabilities.metadata_browse);
assert!(uxdb.capabilities.table_structure_edit);
assert!(!uxdb.capabilities.data_transfer);
assert!(!uxdb.capabilities.user_admin);
let starrocks = find_driver(DatabaseType::StarRocks); let starrocks = find_driver(DatabaseType::StarRocks);
assert!(starrocks.capabilities.user_admin); assert!(starrocks.capabilities.user_admin);
} }
+1
View File
@@ -897,6 +897,7 @@ fn default_port(db_type: &str) -> Option<u16> {
match db_type.trim().to_ascii_lowercase().as_str() { match db_type.trim().to_ascii_lowercase().as_str() {
"mysql" | "doris" | "starrocks" | "manticoresearch" => Some(3306), "mysql" | "doris" | "starrocks" | "manticoresearch" => Some(3306),
"postgres" | "redshift" | "highgo" | "kingbase" | "opengauss" | "gaussdb" => Some(5432), "postgres" | "redshift" | "highgo" | "kingbase" | "opengauss" | "gaussdb" => Some(5432),
"uxdb" => Some(52025),
"redis" => Some(6379), "redis" => Some(6379),
"mongodb" => Some(27017), "mongodb" => Some(27017),
"rqlite" => Some(4001), "rqlite" => Some(4001),
+7 -6
View File
@@ -18,7 +18,7 @@ description: 了解 DBX 可以连接哪些数据库,以及每类高级功能
| 文件型数据库 | SQLite、DuckDB、Microsoft Access、RQLite、Turso | 选择本地数据库文件或 HTTP 端点,不填写主机和端口 | | 文件型数据库 | SQLite、DuckDB、Microsoft Access、RQLite、Turso | 选择本地数据库文件或 HTTP 端点,不填写主机和端口 |
| 时序与边缘数据库 | Cloudflare D1、InfluxDB、IoTDB、TDengine、Databend、QuestDB | 托管 SQLite、时序、IoT 或边缘场景 | | 时序与边缘数据库 | Cloudflare D1、InfluxDB、IoTDB、TDengine、Databend、QuestDB | 托管 SQLite、时序、IoT 或边缘场景 |
| 分析与消息服务 | Apache Spark、Dremio、Apache Pulsar、Apache Kafka、Apache RocketMQ、RabbitMQ | 用于分布式分析、消息和流管理场景 | | 分析与消息服务 | Apache Spark、Dremio、Apache Pulsar、Apache Kafka、Apache RocketMQ、RabbitMQ | 用于分布式分析、消息和流管理场景 |
| Agent/JDBC 扩展类型 | H2、Snowflake、Trino、PrestoSQL、Hive、DB2、Informix、Neo4j、Cassandra、BigQuery、Kylin、SunDB、OSCAR、XuguDB、Databricks、IRIS、JDBC | 功能覆盖取决于对应驱动路径 | | Agent/JDBC 扩展类型 | H2、Snowflake、Trino、PrestoSQL、Hive、DB2、Informix、Neo4j、Cassandra、BigQuery、Kylin、SunDB、OSCAR、XuguDB、UXDB、Databricks、IRIS、JDBC | 功能覆盖取决于对应驱动路径 |
## 默认端口 ## 默认端口
@@ -45,6 +45,7 @@ description: 了解 DBX 可以连接哪些数据库,以及每类高级功能
| DM | 5236 | | DM | 5236 |
| KingBase | 54321 | | KingBase | 54321 |
| HighGo | 5866 | | HighGo | 5866 |
| UXDB | 52025 |
| KWDB | 26257 | | KWDB | 26257 |
| 崖山 YashanDB | 1688 | | 崖山 YashanDB | 1688 |
| GBase | 5258 | | GBase | 5258 |
@@ -98,12 +99,12 @@ DBX 只会在具备足够元数据和 SQL 生成能力的数据库上启用高
| 功能 | 支持类型 | | 功能 | 支持类型 |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Schema 感知树 | PostgreSQL、SQL Server、Oracle、Redshift、DM、GaussDB、KWDB、KingBase、HighGo、Vastbase、JDBC、H2、Snowflake、Trino、DB2、TDengine、XuguDB、Teradata、Vertica、Exasol、Firebird、SAP HANA、YashanDB、GBase | | Schema 感知树 | PostgreSQL、SQL Server、Oracle、Redshift、DM、GaussDB、KWDB、KingBase、HighGo、UXDB、Vastbase、JDBC、H2、Snowflake、Trino、DB2、TDengine、XuguDB、Teradata、Vertica、Exasol、Firebird、SAP HANA、YashanDB、GBase |
| ER 图 | MySQL、PostgreSQL、SQLite、Cloudflare D1、SQL Server、Oracle、Redshift、DM、GaussDB、KWDB、KingBase、HighGo、Vastbase、GoldenDB、Access、H2、DB2、Teradata、Vertica、Firebird、Exasol、GBase、YashanDB | | ER 图 | MySQL、PostgreSQL、SQLite、Cloudflare D1、SQL Server、Oracle、Redshift、DM、GaussDB、KWDB、KingBase、HighGo、UXDB、Vastbase、GoldenDB、Access、H2、DB2、Teradata、Vertica、Firebird、Exasol、GBase、YashanDB |
| 数据库搜索 | MySQL、PostgreSQL、SQLite、SQL Server、Oracle、Redshift、DuckDB、ClickHouse、DM、GaussDB、KWDB、KingBase、HighGo、Vastbase、GoldenDB、Access、H2、Snowflake、Trino、Hive、DB2、Informix、Neo4j、Cassandra、BigQuery、Kylin、SunDB、TDengine、XuguDB、Databricks、Teradata、Vertica | | 数据库搜索 | MySQL、PostgreSQL、SQLite、SQL Server、Oracle、Redshift、DuckDB、ClickHouse、DM、GaussDB、KWDB、KingBase、HighGo、UXDB、Vastbase、GoldenDB、Access、H2、Snowflake、Trino、Hive、DB2、Informix、Neo4j、Cassandra、BigQuery、Kylin、SunDB、TDengine、XuguDB、Databricks、Teradata、Vertica |
| 表数据导入 | MySQL、PostgreSQL、SQLite、Cloudflare D1、DuckDB、ClickHouse、SQL Server、Oracle、Doris、StarRocks、Redshift、DM、GaussDB、KWDB、KingBase、HighGo、Vastbase、GoldenDB、Access、Databend | | 表数据导入 | MySQL、PostgreSQL、SQLite、Cloudflare D1、DuckDB、ClickHouse、SQL Server、Oracle、Doris、StarRocks、Redshift、DM、GaussDB、KWDB、KingBase、HighGo、UXDB、Vastbase、GoldenDB、Access、Databend |
| 几何字段地图预览 | PostgreSQL、HighGo、KingBase、Vastbase、openGauss、GaussDB(PostGIS `geometry` / `geography` 列在结果集中以 WKT 显示,并提供网格工具栏的"地图预览"按钮) | | 几何字段地图预览 | PostgreSQL、HighGo、KingBase、Vastbase、openGauss、GaussDB(PostGIS `geometry` / `geography` 列在结果集中以 WKT 显示,并提供网格工具栏的"地图预览"按钮) |
| 表结构编辑器 | MySQL、PostgreSQL、SQLite、SQL Server、KWDB | | 表结构编辑器 | MySQL、PostgreSQL、SQLite、SQL Server、KWDB、UXDB |
| 创建数据库 | MySQL、PostgreSQL、SQL Server、ClickHouse、Oracle、DM、GaussDB、KWDB、Doris、StarRocks、Redshift、Teradata、Vertica | | 创建数据库 | MySQL、PostgreSQL、SQL Server、ClickHouse、Oracle、DM、GaussDB、KWDB、Doris、StarRocks、Redshift、Teradata、Vertica |
| 字段血缘 | MySQL、PostgreSQL、SQLite、Cloudflare D1、SQL Server、Oracle、Redshift、DM、GaussDB、KWDB | | 字段血缘 | MySQL、PostgreSQL、SQLite、Cloudflare D1、SQL Server、Oracle、Redshift、DM、GaussDB、KWDB |
| 数据传输 | MySQL、PostgreSQL、SQLite、Cloudflare D1、SQL Server、Oracle、ClickHouse、DuckDB、DM、GaussDB、KWDB | | 数据传输 | MySQL、PostgreSQL、SQLite、Cloudflare D1、SQL Server、Oracle、ClickHouse、DuckDB、DM、GaussDB、KWDB |
+7 -6
View File
@@ -18,7 +18,7 @@ The connection dialog exposes ready-to-use profiles with default ports and drive
| File-based engines | SQLite, DuckDB, Microsoft Access, RQLite, Turso | Choose a local database file or HTTP endpoint instead of host and port | | File-based engines | SQLite, DuckDB, Microsoft Access, RQLite, Turso | Choose a local database file or HTTP endpoint instead of host and port |
| Time-series and edge | Cloudflare D1, InfluxDB, IoTDB, TDengine, Databend, QuestDB | Managed SQLite, time-series, IoT, or edge workloads | | Time-series and edge | Cloudflare D1, InfluxDB, IoTDB, TDengine, Databend, QuestDB | Managed SQLite, time-series, IoT, or edge workloads |
| Analytics and messaging services | Apache Spark, Dremio, Apache Pulsar, Apache Kafka, Apache RocketMQ, RabbitMQ | Distributed analytics, messaging, and stream-management workloads | | Analytics and messaging services | Apache Spark, Dremio, Apache Pulsar, Apache Kafka, Apache RocketMQ, RabbitMQ | Distributed analytics, messaging, and stream-management workloads |
| Agent/JDBC-oriented engines | H2, Snowflake, Trino, PrestoSQL, Hive, DB2, Informix, Neo4j, Cassandra, BigQuery, Kylin, SunDB, OSCAR, XuguDB, Databricks, IRIS, JDBC | Feature coverage depends on the driver path used by that engine | | Agent/JDBC-oriented engines | H2, Snowflake, Trino, PrestoSQL, Hive, DB2, Informix, Neo4j, Cassandra, BigQuery, Kylin, SunDB, OSCAR, XuguDB, UXDB, Databricks, IRIS, JDBC | Feature coverage depends on the driver path used by that engine |
## Default Ports ## Default Ports
@@ -45,6 +45,7 @@ The connection dialog exposes ready-to-use profiles with default ports and drive
| DM | 5236 | | DM | 5236 |
| KingBase | 54321 | | KingBase | 54321 |
| HighGo | 5866 | | HighGo | 5866 |
| UXDB | 52025 |
| KWDB | 26257 | | KWDB | 26257 |
| YashanDB | 1688 | | YashanDB | 1688 |
| GBase | 5258 | | GBase | 5258 |
@@ -98,12 +99,12 @@ DBX intentionally enables advanced workflows only where the app has enough metad
| Feature | Supported Types | | Feature | Supported Types |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Schema-aware tree | PostgreSQL, SQL Server, Oracle, Redshift, DM, GaussDB, KWDB, KingBase, HighGo, Vastbase, JDBC, H2, Snowflake, Trino, DB2, TDengine, XuguDB, Teradata, Vertica, Exasol, Firebird, SAP HANA, YashanDB, GBase | | Schema-aware tree | PostgreSQL, SQL Server, Oracle, Redshift, DM, GaussDB, KWDB, KingBase, HighGo, UXDB, Vastbase, JDBC, H2, Snowflake, Trino, DB2, TDengine, XuguDB, Teradata, Vertica, Exasol, Firebird, SAP HANA, YashanDB, GBase |
| ER diagram | MySQL, PostgreSQL, SQLite, Cloudflare D1, SQL Server, Oracle, Redshift, DM, GaussDB, KWDB, KingBase, HighGo, Vastbase, GoldenDB, Access, H2, DB2, Teradata, Vertica, Firebird, Exasol, GBase, YashanDB | | ER diagram | MySQL, PostgreSQL, SQLite, Cloudflare D1, SQL Server, Oracle, Redshift, DM, GaussDB, KWDB, KingBase, HighGo, UXDB, Vastbase, GoldenDB, Access, H2, DB2, Teradata, Vertica, Firebird, Exasol, GBase, YashanDB |
| Database search | MySQL, PostgreSQL, SQLite, SQL Server, Oracle, Redshift, DuckDB, ClickHouse, DM, GaussDB, KWDB, KingBase, HighGo, Vastbase, GoldenDB, Access, H2, Snowflake, Trino, Hive, DB2, Informix, Neo4j, Cassandra, BigQuery, Kylin, SunDB, TDengine, XuguDB, Databricks, Teradata, Vertica | | Database search | MySQL, PostgreSQL, SQLite, SQL Server, Oracle, Redshift, DuckDB, ClickHouse, DM, GaussDB, KWDB, KingBase, HighGo, UXDB, Vastbase, GoldenDB, Access, H2, Snowflake, Trino, Hive, DB2, Informix, Neo4j, Cassandra, BigQuery, Kylin, SunDB, TDengine, XuguDB, Databricks, Teradata, Vertica |
| Table import | MySQL, PostgreSQL, SQLite, Cloudflare D1, DuckDB, ClickHouse, SQL Server, Oracle, Doris, StarRocks, Redshift, DM, GaussDB, KWDB, KingBase, HighGo, Vastbase, GoldenDB, Access, Databend | | Table import | MySQL, PostgreSQL, SQLite, Cloudflare D1, DuckDB, ClickHouse, SQL Server, Oracle, Doris, StarRocks, Redshift, DM, GaussDB, KWDB, KingBase, HighGo, UXDB, Vastbase, GoldenDB, Access, Databend |
| Geometry map preview | PostgreSQL, HighGo, KingBase, Vastbase, openGauss, GaussDB (PostGIS `geometry` / `geography` columns are returned as WKT in the result grid and unlock the grid-toolbar map preview button) | | Geometry map preview | PostgreSQL, HighGo, KingBase, Vastbase, openGauss, GaussDB (PostGIS `geometry` / `geography` columns are returned as WKT in the result grid and unlock the grid-toolbar map preview button) |
| Table structure editor | MySQL, PostgreSQL, SQLite, SQL Server, KWDB | | Table structure editor | MySQL, PostgreSQL, SQLite, SQL Server, KWDB, UXDB |
| Create database | MySQL, PostgreSQL, SQL Server, ClickHouse, Oracle, DM, GaussDB, KWDB, Doris, StarRocks, Redshift, Teradata, Vertica | | Create database | MySQL, PostgreSQL, SQL Server, ClickHouse, Oracle, DM, GaussDB, KWDB, Doris, StarRocks, Redshift, Teradata, Vertica |
| Field lineage | MySQL, PostgreSQL, SQLite, Cloudflare D1, SQL Server, Oracle, Redshift, DM, GaussDB, KWDB | | Field lineage | MySQL, PostgreSQL, SQLite, Cloudflare D1, SQL Server, Oracle, Redshift, DM, GaussDB, KWDB |
| Data transfer | MySQL, PostgreSQL, SQLite, Cloudflare D1, SQL Server, Oracle, ClickHouse, DuckDB, DM, GaussDB, KWDB | | Data transfer | MySQL, PostgreSQL, SQLite, Cloudflare D1, SQL Server, Oracle, ClickHouse, DuckDB, DM, GaussDB, KWDB |
+1 -1
View File
@@ -11,7 +11,7 @@ DBX 使用混合驱动架构:内置 Rust 驱动、独立原生 Agent,以及
| ------------ | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | ------------ | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| 原生(内置) | Rust 驱动编译进 DBX | MySQL、PostgreSQL、SQLite、SQL Server、Redis、MongoDB、DuckDB、ClickHouse 等 | | 原生(内置) | Rust 驱动编译进 DBX | MySQL、PostgreSQL、SQLite、SQL Server、Redis、MongoDB、DuckDB、ClickHouse 等 |
| 原生 Agent | DBX 管理的 Go/Rust 独立进程 | Oracle、KingBase、虚谷 XuguDB,以及存在成熟原生驱动的数据库 | | 原生 Agent | DBX 管理的 Go/Rust 独立进程 | Oracle、KingBase、虚谷 XuguDB,以及存在成熟原生驱动的数据库 |
| JDBC Agent | DBX 管理的 Java 子进程 | 需要 JDBC 的数据库:GaussDB、openGauss、DM、HighGo、Vastbase、Trino、Hive、DB2、Informix、Neo4j、TDengine、YashanDB、GoldenDB、Kylin、SunDB 等 | | JDBC Agent | DBX 管理的 Java 子进程 | 需要 JDBC 的数据库:GaussDB、openGauss、DM、HighGo、Vastbase、UXDB、Trino、Hive、DB2、Informix、Neo4j、TDengine、YashanDB、GoldenDB、Kylin、SunDB 等 |
<Callout type="info">内置驱动可直接使用;原生 Agent 只需对应平台的可执行文件,JDBC Agent 还需要 JRE。首次创建连接时 DBX 会自动安装匹配的组件。</Callout> <Callout type="info">内置驱动可直接使用;原生 Agent 只需对应平台的可执行文件,JDBC Agent 还需要 JRE。首次创建连接时 DBX 会自动安装匹配的组件。</Callout>
+1 -1
View File
@@ -11,7 +11,7 @@ DBX uses a hybrid driver architecture: built-in Rust drivers, standalone native
| ----------------- | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ----------------- | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Native (built-in) | Rust drivers compiled into DBX | MySQL, PostgreSQL, SQLite, SQL Server, Redis, MongoDB, DuckDB, ClickHouse, and more | | Native (built-in) | Rust drivers compiled into DBX | MySQL, PostgreSQL, SQLite, SQL Server, Redis, MongoDB, DuckDB, ClickHouse, and more |
| Native Agent | Standalone Go/Rust process managed by DBX | Oracle, KingBase, XuguDB, and databases with a mature native driver | | Native Agent | Standalone Go/Rust process managed by DBX | Oracle, KingBase, XuguDB, and databases with a mature native driver |
| JDBC Agent | Java subprocess managed by DBX | Databases that require JDBC: GaussDB, openGauss, DM, HighGo, Vastbase, Trino, Hive, DB2, Informix, Neo4j, TDengine, YashanDB, GoldenDB, Kylin, SunDB, and more | | JDBC Agent | Java subprocess managed by DBX | Databases that require JDBC: GaussDB, openGauss, DM, HighGo, Vastbase, UXDB, Trino, Hive, DB2, Informix, Neo4j, TDengine, YashanDB, GoldenDB, Kylin, SunDB, and more |
<Callout type="info">Built-in drivers work immediately. Native Agents require only a platform-specific executable, while JDBC Agents also require a JRE. DBX handles the matching installation when you first create a connection.</Callout> <Callout type="info">Built-in drivers work immediately. Native Agents require only a platform-specific executable, while JDBC Agents also require a JRE. DBX handles the matching installation when you first create a connection.</Callout>
+1
View File
@@ -137,6 +137,7 @@ const driverLabels: Record<string, string> = {
tdengine: "TDengine", tdengine: "TDengine",
teradata: "Teradata", teradata: "Teradata",
trino: "Trino", trino: "Trino",
uxdb: "优炫 UXDB",
vastbase: "Vastbase", vastbase: "Vastbase",
vertica: "Vertica", vertica: "Vertica",
xugu: "虚谷 XuguDB", xugu: "虚谷 XuguDB",