fix: DBeaver 25+ compat, add native ClickHouse HTTP driver#22
Open
mason-respark wants to merge 2 commits intosrthkdev:mainfrom
Open
fix: DBeaver 25+ compat, add native ClickHouse HTTP driver#22mason-respark wants to merge 2 commits intosrthkdev:mainfrom
mason-respark wants to merge 2 commits intosrthkdev:mainfrom
Conversation
added 2 commits
April 24, 2026 14:52
DBeaver 25 removed the `-o` and `-of` CLI flags that the CLI fallback in `executeViaCli` (and `exportData`) relied on. On DBeaver 25+, those flags are silently ignored — DBeaver opens the UI, connects, and never exits — so every query through the CLI fallback timed out at 30s (`DBeaver execution timed out after 30000ms`). Drivers routed through this path (Oracle, ClickHouse, etc.) were effectively broken. Changes: - Add a native ClickHouse branch using the ClickHouse HTTP interface (`default_format=JSON`). TLS is selected when `ssl=true` is set on the DBeaver connection or when the port is 443/8443. Auth via `X-ClickHouse-User` / `X-ClickHouse-Key` headers. Works with the `clickhouse-ssl` handler block and nested `properties.properties.ssl` that DBeaver writes into `data-sources.json`. - Remove the DBeaver CLI query fallback (`executeViaCli`, `executeCli`, `isCliAvailable`, `parseCSVOutput`, `cleanupFiles`). Unsupported drivers now fail fast with a clear error listing the natively supported drivers instead of hanging for the full timeout. - Route `exportData` through the native drivers and convert to CSV/JSON in-process, so export is no longer dependent on the broken CLI path. - Drop unused `executablePath` field and the `csv-parser` usage. The constructor's first parameter is preserved (as `_executablePath`) so existing callers that pass it continue to compile. Tests: new `tests/workspace-client.test.ts` covers ClickHouse URL/auth construction, HTTPS auto-detection by port, explicit SSL disable, error-body surfacing, DDL empty-body handling, and the fail-fast error for unsupported drivers. Verified end-to-end against a real DBeaver 26.0.3 workspace with ClickHouse (HTTPS), MySQL, and PostgreSQL connections — all four datasources resolve `test_connection` and `SELECT 1` successfully.
`test_connection` on a ClickHouse datasource fell through to the generic `SELECT 1;` test query, so `databaseVersion` was reported as "1" rather than the real server version. Add a ClickHouse branch that mirrors the existing Postgres/MySQL pattern.
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DBeaver 25 removed the
-oand-ofCLI flags thatexecuteViaCli(the fallback used for drivers without a native implementation) andexportDataboth rely on. On DBeaver 25+ those flags are silently ignored — DBeaver opens the UI, connects to the datasource, and never exits — so every query through the CLI fallback times out at 30 s (DBeaver execution timed out after 30000ms), andexport_datahits the same hang. Drivers routed through the fallback (Oracle, ClickHouse pre-patch, etc.) are effectively broken on DBeaver 25+.Verified repro on DBeaver 26.0.3 against a ClickHouse datasource: every
test_connection/execute_queryfails with the timeout above. Thedbeaver-helpallow-list no longer contains-oor-of, and DBeaver printsParameter(s) -o -of csv cannot be specified after 'dbeaver'to its debug log before falling through to the UI.Changes
default_format=JSON). TLS is selected whenssl=trueis set on the DBeaver connection or when the port is 443/8443. Auth viaX-ClickHouse-User/X-ClickHouse-Keyheaders. Handles theclickhouse-sslhandler block and the nestedproperties.properties.ssllayout that DBeaver writes intodata-sources.json.executeViaCli,executeCli,isCliAvailable,parseCSVOutput,cleanupFiles). Unsupported drivers now fail fast with a clear error listing the natively supported drivers (PostgreSQL + compatibles, MySQL/MariaDB, MSSQL, SQLite, ClickHouse) instead of hanging for the full timeout.exportDatathrough the native drivers. CSV/JSON is produced in-process via the existingconvertToCSVhelper, so export no longer depends on the broken CLI path.executablePathfield and thecsv-parserusage inworkspace-client.ts. The constructor's first parameter is preserved (as_executablePath) so existing callers that pass it continue to compile.Net code delta: +135 / −180 lines (dead CLI plumbing removed).
Test plan
npm run typecheckpassesnpm run lintpassesnpm test— 49 tests pass (was 43; added 6 new forworkspace-client.test.ts)test_connectionandSELECT 1successfully after the patch; all four timed out at 30 s before it (MySQL/Postgres were only unaffected because they already had native branches — the ClickHouse connection was the original repro).oracle_thin) now throwsDatabase driver "oracle_thin" is not supported...immediately instead of hanging.Notes
[Unreleased]block; happy to land under a specific version header instead if you prefer.DatabaseConnection.propertiestype isRecord<string, string>today, but theclickhouse-sslhandlers block is an object. The ClickHouse driver reads through a pair ofunknowncasts for that case — matches how the existing Postgres branch handleshandlers.postgre_ssl.fetchis built-in on Node ≥18, which is already the minimum inengines.node.