25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
fix(prestosql): select builtin JDBC driver
t8y2e9dafbf38dee
diff --git a/apps/desktop/src/components/connection/ConnectionDialog.vue b/apps/desktop/src/components/connection/ConnectionDialog.vueindex 067986810c..f4b45d6555 100644--- a/apps/desktop/src/components/connection/ConnectionDialog.vue+++ b/apps/desktop/src/components/connection/ConnectionDialog.vue@@ -30,6 +30,7 @@ import { MQ_PINNED_VERSION_OPTIONS, pinnedVersionToSelection, selectionToPinnedVimport { mongodbAuthFailureHint, mongoUrlParam, setMongoUrlParam } from "@/lib/mongoConnectionOptions";import { copyToClipboard } from "@/lib/clipboard";import { showAgentDriverInstallHint, type AgentDriverInstallState } from "@/lib/agentDriverInstallHint";+import { prestoSqlBuiltinDriverPaths } from "@/lib/prestoSqlBuiltinDriver";import { ArrowLeft, ArrowDown, ArrowUp, CheckSquare, ChevronRight, CircleHelp, Copy, ExternalLink, FilePlus2, FolderOpen, GripVertical, Grid3X3, KeyRound, Link2, List, ListFilter, Loader2, Pipette, Plus, Search, ShieldCheck, Square, Trash2 } from "@lucide/vue";import { buildDraftVisibleDatabasesConnectionId, connectionCanChooseVisibleDatabases, initialVisibleDatabaseSelection, visibleDatabaseSelectionIsStale } from "@/lib/connectionVisibleDatabases";import { canSaveVisibleDatabaseSelection, filterDatabaseNamesForConnection, isSystemDatabaseName, normalizeVisibleDatabaseSelection } from "@/lib/visibleDatabases";@@ -1390,6 +1391,7 @@ function connectionConfigForSubmit(id: string): ConnectionConfig {} else if (config.db_type === "prestosql") {config.connection_string = undefined;config.jdbc_driver_class = config.jdbc_driver_class?.trim() || "io.prestosql.jdbc.PrestoDriver";+ applyPrestoSqlBuiltinDriverPathsIfAvailable();}config.jdbc_driver_class = config.jdbc_driver_class?.trim() || undefined;config.jdbc_driver_paths = jdbcDriverPathsInput.value@@ -2256,6 +2258,7 @@ async function loadJdbcDrivers() {const [drivers, bundles] = await Promise.all([api.listJdbcDrivers(), api.listJdbcMavenBundles()]);jdbcDrivers.value = drivers;jdbcMavenBundles.value = bundles;+ applyPrestoSqlBuiltinDriverPathsIfAvailable();} catch {jdbcDrivers.value = [];jdbcMavenBundles.value = [];@@ -2287,6 +2290,15 @@ function addJdbcDriverPaths(paths: string[]) {jdbcDriverPathsInput.value = Array.from(new Set([...existing, ...paths])).join("\n");}+function applyPrestoSqlBuiltinDriverPathsIfAvailable() {+ if (form.value.db_type !== "prestosql" || jdbcManualClasspathCount.value > 0) return;+ const paths = prestoSqlBuiltinDriverPaths(jdbcMavenBundles.value);+ if (paths.length === 0) return;+ addJdbcDriverPaths(paths);+ selectedJdbcDriverPath.value = jdbcDriverSelectItems.value.find((item) => paths.every((path) => item.paths.includes(path)))?.id ?? "";+ jdbcManualClasspathOpen.value = false;+}+function onJdbcDriverSelect(id: any) {if (typeof id !== "string" || !id) return;const item = jdbcDriverSelectItemById.value.get(id);diff --git a/apps/desktop/src/lib/__tests__/connectionAttemptTimeout.spec.ts b/apps/desktop/src/lib/__tests__/connectionAttemptTimeout.spec.tsindex caa1667e00..543f72c24c 100644--- a/apps/desktop/src/lib/__tests__/connectionAttemptTimeout.spec.ts+++ b/apps/desktop/src/lib/__tests__/connectionAttemptTimeout.spec.ts@@ -14,6 +14,10 @@ describe("connectionAttemptTimeout", () => {expect(connectionAttemptTimeoutMs({ db_type: "oracle", connect_timeout_secs: 5, transport_layers: [] })).toBe(AGENT_DRIVER_MIN_CONNECT_TIMEOUT_SECS * 1000 + CONNECTION_ATTEMPT_TIMEOUT_BUFFER_MS);});+ it("uses the startup floor for PrestoSQL JDBC plugin connections", () => {+ expect(connectionAttemptTimeoutMs({ db_type: "prestosql", connect_timeout_secs: 5, transport_layers: [] })).toBe(AGENT_DRIVER_MIN_CONNECT_TIMEOUT_SECS * 1000 + CONNECTION_ATTEMPT_TIMEOUT_BUFFER_MS);+ });+it("uses a 30s Access agent startup floor", () => {expect(connectionAttemptTimeoutMs({ db_type: "access", connect_timeout_secs: 5, transport_layers: [] })).toBe(ACCESS_AGENT_MIN_CONNECT_TIMEOUT_SECS * 1000 + CONNECTION_ATTEMPT_TIMEOUT_BUFFER_MS);});diff --git a/apps/desktop/src/lib/__tests__/prestoSqlBuiltinDriver.spec.ts b/apps/desktop/src/lib/__tests__/prestoSqlBuiltinDriver.spec.tsindex 8b0cefdedc..2561499f7b 100644--- a/apps/desktop/src/lib/__tests__/prestoSqlBuiltinDriver.spec.ts+++ b/apps/desktop/src/lib/__tests__/prestoSqlBuiltinDriver.spec.ts@@ -1,5 +1,5 @@import { describe, expect, it } from "vitest";-import { PRESTOSQL_JDBC_DRIVER_COORDINATE, prestoSqlBuiltinDriverRow, prestoSqlMavenBundle } from "@/lib/prestoSqlBuiltinDriver";+import { PRESTOSQL_JDBC_DRIVER_COORDINATE, prestoSqlBuiltinDriverPaths, prestoSqlBuiltinDriverRow, prestoSqlMavenBundle } from "@/lib/prestoSqlBuiltinDriver";import type { JdbcMavenBundleInfo } from "@/types/database";function bundle(coordinate: string, version = "350"): JdbcMavenBundleInfo {@@ -43,6 +43,7 @@ describe("prestoSqlBuiltinDriver", () => {const row = prestoSqlBuiltinDriverRow([bundle("com.mysql:mysql-connector-j:9.2.0"), installed]);expect(prestoSqlMavenBundle([installed])?.id).toBe(installed.id);+ expect(prestoSqlBuiltinDriverPaths([installed])).toEqual(["drivers/jdbc/presto-jdbc-350.jar"]);expect(row.installed).toBe(true);expect(row.installed_version).toBe("350");});diff --git a/apps/desktop/src/lib/connectionAttemptTimeout.ts b/apps/desktop/src/lib/connectionAttemptTimeout.tsindex 1d7cf5fa27..279e35cc3c 100644--- a/apps/desktop/src/lib/connectionAttemptTimeout.ts+++ b/apps/desktop/src/lib/connectionAttemptTimeout.ts@@ -6,7 +6,7 @@ export const AGENT_DRIVER_MIN_CONNECT_TIMEOUT_SECS = 30;export const ACCESS_AGENT_MIN_CONNECT_TIMEOUT_SECS = 30;const DEFAULT_CONNECT_TIMEOUT_SECS = 10;-const AGENT_DRIVER_TYPES = new Set<DatabaseType>([+const DRIVER_STARTUP_FLOOR_TYPES = new Set<DatabaseType>(["dameng","kingbase","highgo",@@ -49,7 +49,7 @@ function positiveSeconds(value: unknown, fallback: number): number {export function connectionAttemptTimeoutMs(config: Pick<ConnectionConfig, "connect_timeout_secs" | "transport_layers"> & Partial<Pick<ConnectionConfig, "db_type">>): number {const baseTimeoutSecs = positiveSeconds(config.connect_timeout_secs, DEFAULT_CONNECT_TIMEOUT_SECS);const agentMinTimeoutSecs = config.db_type === "access" ? ACCESS_AGENT_MIN_CONNECT_TIMEOUT_SECS : AGENT_DRIVER_MIN_CONNECT_TIMEOUT_SECS;- const timeouts = [AGENT_DRIVER_TYPES.has(config.db_type as DatabaseType) ? Math.max(baseTimeoutSecs, agentMinTimeoutSecs) : baseTimeoutSecs];+ const timeouts = [DRIVER_STARTUP_FLOOR_TYPES.has(config.db_type as DatabaseType) ? Math.max(baseTimeoutSecs, agentMinTimeoutSecs) : baseTimeoutSecs];for (const layer of config.transport_layers ?? []) {if (layer.type === "ssh") {timeouts.push(positiveSeconds(layer.connect_timeout_secs, DEFAULT_CONNECT_TIMEOUT_SECS));diff --git a/apps/desktop/src/lib/prestoSqlBuiltinDriver.ts b/apps/desktop/src/lib/prestoSqlBuiltinDriver.tsindex c76a9a6535..cdfc008073 100644--- a/apps/desktop/src/lib/prestoSqlBuiltinDriver.ts+++ b/apps/desktop/src/lib/prestoSqlBuiltinDriver.ts@@ -10,6 +10,10 @@ export function prestoSqlMavenBundle(bundles: JdbcMavenBundleInfo[]): JdbcMavenBreturn bundles.find((bundle) => bundle.coordinate === PRESTOSQL_JDBC_DRIVER_COORDINATE);}+export function prestoSqlBuiltinDriverPaths(bundles: JdbcMavenBundleInfo[]): string[] {+ return (prestoSqlMavenBundle(bundles)?.artifacts ?? []).map((artifact) => artifact.path).filter(Boolean);+}+export function prestoSqlBuiltinDriverRow(bundles: JdbcMavenBundleInfo[]): AgentDriverInfo {const installedBundle = prestoSqlMavenBundle(bundles);return {