feat(argo): add argodb connection type with routine browsing

This commit is contained in:
wangfengxiang authored and GitHub committed 2026-09-01 00:21:10 +08:00
1 parent 5eb071bc22
commit 2f71a1a8aa
34 files changed
+492 -48

No files matched your search

@@ -33,7 +33,7 @@ export function hasInstalledAgentVersion(drivers: readonly AgentDriverInstallSta
export function agentDriverInstallKey(dbType: DatabaseType | undefined, driverProfile?: string, context?: AgentDriverInstallContext): string | undefined {
if (dbType === "sqlite") return context?.ssh ? "sqlite-worker" : undefined;
if (dbType === "kyuubi" || dbType === "impala") return "hive";
if (dbType === "kyuubi" || dbType === "impala" || dbType === "argo") return "hive";
if (dbType === "oracle") return "oracle";
if (dbType === "h2") return "h2";
if (dbType === "mongodb") return "mongodb";
@@ -34,6 +34,7 @@ const DRIVER_STARTUP_FLOOR_TYPES = new Set<DatabaseType>([
"hive",
"kyuubi",
"impala",
"argo",
"spark",
"db2",
"informix",
+1 -1
View File
@@ -168,7 +168,7 @@ export function buildHiveTablePropertiesSql(options: HiveTablePropertiesSqlOptio
export function normalizeDataGridSaveError(databaseType: DatabaseType | undefined, error: unknown): string {
const message = error instanceof Error ? error.message : String(error);
if (databaseType === "hive" && /Attempt to do update or delete|Error 10294/i.test(message)) {
if ((databaseType === "hive" || databaseType === "argo") && /Attempt to do update or delete|Error 10294/i.test(message)) {
return "Hive UPDATE/DELETE are not enabled for this table or server. Add rows with INSERT, or enable ACID transactional tables in Hive before editing/deleting existing rows.";
}
return message;
@@ -4,7 +4,7 @@ import { manifestDatabaseTypes } from "@/lib/database/databaseDriverManifest";
import { supportsTransfer } from "@/lib/database/databaseFeatureSupport";
import type { DatabaseType } from "@/types/database";
const TABLE_ONLY_TRANSFER_DATABASES: DatabaseType[] = ["sqlite", "rqlite", "turso", "cloudflare-d1", "duckdb", "clickhouse", "mongodb", "goldendb", "questdb", "hive", "kyuubi", "impala", "spark"];
const TABLE_ONLY_TRANSFER_DATABASES: DatabaseType[] = ["sqlite", "rqlite", "turso", "cloudflare-d1", "duckdb", "clickhouse", "mongodb", "goldendb", "questdb", "hive", "argo", "kyuubi", "impala", "spark"];
describe("transferObjectKinds", () => {
it("groups databases into transfer families", () => {
@@ -68,6 +68,7 @@ export const DATABASE_NAMESPACE_CREATION_MATRIX = {
trino: { database: "schema" },
prestosql: { database: "schema" },
hive: { deferred: "Hive database creation needs agent metadata validation first" },
argo: { deferred: "ArgoDB database creation needs agent metadata validation first" },
kyuubi: { deferred: "Kyuubi database creation needs dedicated metadata validation first" },
impala: { deferred: "Impala database creation needs dedicated metadata validation first" },
spark: { deferred: "Spark database creation needs agent metadata validation first" },
@@ -71,6 +71,9 @@ const DATABASE_TYPE_OBJECTS = new Map<DatabaseType, SidebarObjectKind[]>([
["starrocks", TABLE_VIEW_MV_OBJECTS],
// Inceptor/Hive routines can be listed via JDBC plugin fallbacks (system.procedures_v/functions_v).
["hive", ROUTINE_OBJECTS],
// ArgoDB (Transwarp) shares the Hive agent; its catalog views
// (system.procedures_v / system.functions_v) expose routines natively.
["argo", ROUTINE_OBJECTS],
["kyuubi", TABLE_VIEW_OBJECTS],
["impala", TABLE_VIEW_OBJECTS],
["spark", TABLE_VIEW_OBJECTS],
@@ -68,6 +68,7 @@ export const DATABASE_PROPERTY_EDITING_MATRIX = {
trino: { deferred: "catalog properties are connector-managed" },
prestosql: { deferred: "catalog properties are connector-managed" },
hive: { deferred: "database properties need agent metadata validation first" },
argo: { deferred: "database properties need agent metadata validation first" },
kyuubi: { deferred: "database properties need Kyuubi-specific validation first" },
impala: { deferred: "database properties need Impala-specific validation first" },
spark: { deferred: "database properties need agent metadata validation first" },
@@ -123,6 +123,16 @@ const DATABASE_CAPABILITY_OVERRIDES: Partial<Record<DatabaseType, Partial<Databa
transaction: false,
},
},
argo: {
tableData: {
insert: true,
updateRequiresPrimaryKey: false,
deleteRequiresPrimaryKey: false,
keylessRowPredicate: true,
requiresTransactionalTableForExistingRows: true,
transaction: false,
},
},
jdbc: {
tableData: {
insert: false,
+1 -1
View File
@@ -15,7 +15,7 @@ const GAUSSDB_COUNT_QUERY_DOP_KEY = "gaussdbCountQueryDop";
export const GAUSSDB_M_JDBC_DRIVER_PROFILE = "gaussdb-m";
export const GAUSSDB_M_JDBC_DRIVER_CLASS = "com.huawei.gaussdb.jdbc.Driver";
const DATABASE_AS_EXECUTION_SCHEMA_TYPES = new Set<DatabaseType>(["hive", "kyuubi", "impala", "spark"]);
const DATABASE_AS_EXECUTION_SCHEMA_TYPES = new Set<DatabaseType>(["hive", "kyuubi", "impala", "argo", "spark"]);
const CONNECTION_ROOT_SCHEMA_TYPES = new Set<DatabaseType>(["oracle", "dameng", "oceanbase-oracle"]);
const JDBC_DIALECT_MATCHERS: Array<{ type: DatabaseType; patterns: RegExp[] }> = [
@@ -3,7 +3,7 @@ import { qualifiedTableName, quoteTableIdentifier } from "@/lib/table/tableSelec
import { requiresMysqlIdentifierQuote, requiresPostgresIdentifierQuote } from "@/lib/sql/sqlIdentifier.ts";
/** 智能引号使用反引号的方言族。 */
const SMART_QUOTE_BACKTICK_TYPES = new Set<DatabaseType>(["mysql", "clickhouse", "hive", "kyuubi", "impala", "spark", "databricks", "databend", "tdengine", "access", "doris", "starrocks", "goldendb"]);
const SMART_QUOTE_BACKTICK_TYPES = new Set<DatabaseType>(["mysql", "clickhouse", "hive", "argo", "kyuubi", "impala", "spark", "databricks", "databend", "tdengine", "access", "doris", "starrocks", "goldendb"]);
/** 智能引号使用双引号的方言族(SQL Server 方括号除外)。 */
const SMART_QUOTE_DOUBLE_TYPES = new Set<DatabaseType>(["postgres", "gaussdb", "opengauss"]);
/** SQL Server 族智能引号使用方括号。 */
+3 -3
View File
@@ -1308,7 +1308,7 @@ type SqlCompletionApplyDialect = "mysql" | "postgres" | "sqlserver" | "oracle" |
// QueryEditor may use another dialect as a CodeMirror syntax fallback.
// Completion apply text must still follow the connected database's identifier
// folding and quoting rules.
const MYSQL_LIKE_IDENTIFIER_DATABASES = new Set<DatabaseType>(["mysql", "clickhouse", "hive", "kyuubi", "impala", "spark", "databend", "tdengine", "access", "doris", "starrocks"]);
const MYSQL_LIKE_IDENTIFIER_DATABASES = new Set<DatabaseType>(["mysql", "clickhouse", "hive", "argo", "kyuubi", "impala", "spark", "databend", "tdengine", "access", "doris", "starrocks"]);
const POSTGRES_LIKE_IDENTIFIER_DATABASES = new Set<DatabaseType>(["postgres", "redshift", "gaussdb", "kingbase", "highgo", "uxdb", "vastbase", "kwdb", "opengauss"]);
const ORACLE_COMPAT_IDENTIFIER_DATABASES = new Set<DatabaseType>(["oracle", "oceanbase-oracle", "yashandb", "oscar", "xugu"]);
const UPPER_FOLDING_IDENTIFIER_DATABASES = new Set<DatabaseType>(["dameng", "db2"]);
@@ -2867,7 +2867,7 @@ function lastTopLevelKeywordIndex(sql: string, keyword: string): number {
// unquoted token as a table reference there is a false-positive risk. Everything else defaults
// to Unicode support (MySQL/Postgres/SQL Server/SQLite/DuckDB and the many Chinese-vendor
// engines this product supports legitimately use non-ASCII unquoted identifiers).
const ASCII_ONLY_UNQUOTED_IDENTIFIER_DATABASES = new Set<DatabaseType>(["clickhouse", "snowflake", "bigquery", "hive", "spark", "trino", "prestosql", "impala", "db2", "teradata"]);
const ASCII_ONLY_UNQUOTED_IDENTIFIER_DATABASES = new Set<DatabaseType>(["clickhouse", "snowflake", "bigquery", "hive", "argo", "spark", "trino", "prestosql", "impala", "db2", "teradata"]);
// Dialects where a bare "--" needs trailing whitespace/EOL to start a comment, since MySQL
// reserves unspaced "--" for double-negation (e.g. `SELECT 1--1`). Scoped to mysql itself plus
@@ -2887,7 +2887,7 @@ const MYSQL_DASH_COMMENT_DIALECTS = new Set<DatabaseType>(["mysql", "doris", "st
// why that's unsafe (a trailing backslash before a closing quote in a dialect that doesn't escape
// it, e.g. a Postgres Windows-path string literal, would misread the real closing quote as
// escaped and swallow the rest of the query).
const BACKSLASH_ESCAPE_STRING_DIALECTS = new Set<DatabaseType>(["mysql", "doris", "starrocks", "hive", "impala", "spark"]);
const BACKSLASH_ESCAPE_STRING_DIALECTS = new Set<DatabaseType>(["mysql", "doris", "starrocks", "hive", "argo", "impala", "spark"]);
// Table/schema/db unquoted-identifier continue class needs @ and # in addition to what
// SQL_IDENTIFIER_CONTINUE_CHAR covers, so splice its inner class body into a locally-built class
+1 -1
View File
@@ -272,7 +272,7 @@ export function importDataTypeForDatabase(inferredType: ImportInferredType, data
if (databaseType === "sqlserver") return "NVARCHAR(MAX)";
if (databaseType === "oracle" || databaseType === "oceanbase-oracle" || databaseType === "dameng") return "CLOB";
if (databaseType === "clickhouse") return "String";
if (["hive", "trino", "prestosql", "databricks"].includes(databaseType || "")) return "STRING";
if (["hive", "argo", "trino", "prestosql", "databricks"].includes(databaseType || "")) return "STRING";
return "TEXT";
}
}
@@ -69,6 +69,7 @@ export function quoteTableIdentifier(databaseType: DatabaseType | undefined, nam
databaseType === "mysql" ||
databaseType === "clickhouse" ||
databaseType === "hive" ||
databaseType === "argo" ||
databaseType === "kyuubi" ||
databaseType === "impala" ||
databaseType === "spark" ||