1.21 beta1#830
Merged
Merged
Conversation
## Summary The `@typescript-eslint/ban-ts-comment` rule was only disabled for test files via `testFilesOverrides`, leaving it enabled for source files. This disables it globally. - **`eslint.config.base.mjs`**: add `'@typescript-eslint/ban-ts-comment': 'off'` to the shared `typescriptEslintConfig` rules. ## Checklist - [ ] A human-readable description of the changes was provided to include in CHANGELOG --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
…lPropertyTypes) (#793) ## Summary Enable additional TypeScript strictness options not already covered by `strict` in `tsconfig.base.json` and fix the resulting errors. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Peter Leonov <peter.leonov@clickhouse.com>
Bumps version from `1.20.0` to `1.21.0` (minor bump). Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
## Summary
Removes all TypeScript-only syntax extensions that emit runtime code, so
the project can be built/typechecked with `--erasableSyntaxOnly` (and
consumed by runtimes like Node's native TS stripping). The option is
enabled in `tsconfig.base.json` to lock this in.
- **Enums → `as const` object + type alias.** Preserves `Foo.Bar` member
access and runtime values. Applied to internal/test enums (`TestEnv`,
`TestConnectionType`, local test enums in
`select_query_binding.test.ts`).
- **Public `ClickHouseLogLevel` → `as const` object that mimics the
TS-compiled enum shape.** The object contains both forward (`TRACE: 0`,
…) and reverse (`0: 'TRACE'`, …) entries — the same runtime layout `tsc`
emits for a numeric `enum` — so both `ClickHouseLogLevel.TRACE` and
`ClickHouseLogLevel[0]` continue to work for downstream TS consumers.
The exported type is the literal numeric union (`0 | 1 | 2 | 3 | 4 |
127`), matching the old enum's value type.
- **Constructor parameter properties → explicit field declarations +
assignments.** Applied to `TupleParam`, `SettingsMap`, `LogWriter`,
`WebConnection`, web/node `ResultSet`, `NodeBaseConnection`,
`SocketPool`, and the `BufferReader` test helper.
- **`tsconfig.base.json`**: `"erasableSyntaxOnly": true`.
Example of the enum transform — call sites such as
`ClickHouseLogLevel.TRACE` and reverse lookups like
`ClickHouseLogLevel[0]` continue to work:
```ts
export const ClickHouseLogLevel = {
TRACE: 0, DEBUG: 1, INFO: 2, WARN: 3, ERROR: 4, OFF: 127,
0: 'TRACE', 1: 'DEBUG', 2: 'INFO', 3: 'WARN', 4: 'ERROR', 127: 'OFF',
} as const
export type ClickHouseLogLevel = 0 | 1 | 2 | 3 | 4 | 127
```
No namespaces or `import = require(...)` exist in the tree, so nothing
else needed to change.
## Checklist
- [x] A human-readable description of the changes was provided to
include in CHANGELOG
### CHANGELOG
- Internal: TypeScript sources are now compatible with the
`--erasableSyntaxOnly` compiler option. `ClickHouseLogLevel` is now
exported as a `const` object plus a union type instead of a TS `enum`,
but keeps the same bidirectional runtime shape (both `Name → number` and
`number → Name` entries) that `tsc` emits for numeric enums, so existing
usage like `ClickHouseLogLevel.TRACE` and `ClickHouseLogLevel[0]` is
unchanged.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <copilot@github.com>
Co-authored-by: Peter Leonov <peter.leonov@clickhouse.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 6.0.3. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/releases">actions/checkout's releases</a>.</em></p> <blockquote> <h2>v6.0.3</h2> <h2>What's Changed</h2> <ul> <li>Update changelog by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2357">actions/checkout#2357</a></li> <li>fix: expand merge commit SHA regex and add SHA-256 test cases by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2414">actions/checkout#2414</a></li> <li>Fix checkout init for SHA-256 repositories by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2439">actions/checkout#2439</a></li> <li>Update changelog for v6.0.3 by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2446">actions/checkout#2446</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/yaananth"><code>@yaananth</code></a> made their first contribution in <a href="https://redirect.github.com/actions/checkout/pull/2414">actions/checkout#2414</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/checkout/compare/v6...v6.0.3">https://github.com/actions/checkout/compare/v6...v6.0.3</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/blob/main/CHANGELOG.md">actions/checkout's changelog</a>.</em></p> <blockquote> <h1>Changelog</h1> <h2>v6.0.3</h2> <ul> <li>Fix checkout init for SHA-256 repositories by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2439">actions/checkout#2439</a></li> <li>fix: expand merge commit SHA regex and add SHA-256 test cases by <a href="https://github.com/yaananth"><code>@yaananth</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2414">actions/checkout#2414</a></li> </ul> <h2>v6.0.2</h2> <ul> <li>Fix tag handling: preserve annotations and explicit fetch-tags by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2356">actions/checkout#2356</a></li> </ul> <h2>v6.0.1</h2> <ul> <li>Add worktree support for persist-credentials includeIf by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2327">actions/checkout#2327</a></li> </ul> <h2>v6.0.0</h2> <ul> <li>Persist creds to a separate file by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2286">actions/checkout#2286</a></li> <li>Update README to include Node.js 24 support details and requirements by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2248">actions/checkout#2248</a></li> </ul> <h2>v5.0.1</h2> <ul> <li>Port v6 cleanup to v5 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2301">actions/checkout#2301</a></li> </ul> <h2>v5.0.0</h2> <ul> <li>Update actions checkout to use node 24 by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2226">actions/checkout#2226</a></li> </ul> <h2>v4.3.1</h2> <ul> <li>Port v6 cleanup to v4 by <a href="https://github.com/ericsciple"><code>@ericsciple</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2305">actions/checkout#2305</a></li> </ul> <h2>v4.3.0</h2> <ul> <li>docs: update README.md by <a href="https://github.com/motss"><code>@motss</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1971">actions/checkout#1971</a></li> <li>Add internal repos for checking out multiple repositories by <a href="https://github.com/mouismail"><code>@mouismail</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1977">actions/checkout#1977</a></li> <li>Documentation update - add recommended permissions to Readme by <a href="https://github.com/benwells"><code>@benwells</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2043">actions/checkout#2043</a></li> <li>Adjust positioning of user email note and permissions heading by <a href="https://github.com/joshmgross"><code>@joshmgross</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2044">actions/checkout#2044</a></li> <li>Update README.md by <a href="https://github.com/nebuk89"><code>@nebuk89</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2194">actions/checkout#2194</a></li> <li>Update CODEOWNERS for actions by <a href="https://github.com/TingluoHuang"><code>@TingluoHuang</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2224">actions/checkout#2224</a></li> <li>Update package dependencies by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/2236">actions/checkout#2236</a></li> </ul> <h2>v4.2.2</h2> <ul> <li><code>url-helper.ts</code> now leverages well-known environment variables by <a href="https://github.com/jww3"><code>@jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1941">actions/checkout#1941</a></li> <li>Expand unit test coverage for <code>isGhes</code> by <a href="https://github.com/jww3"><code>@jww3</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1946">actions/checkout#1946</a></li> </ul> <h2>v4.2.1</h2> <ul> <li>Check out other refs/* by commit if provided, fall back to ref by <a href="https://github.com/orhantoy"><code>@orhantoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1924">actions/checkout#1924</a></li> </ul> <h2>v4.2.0</h2> <ul> <li>Add Ref and Commit outputs by <a href="https://github.com/lucacome"><code>@lucacome</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1180">actions/checkout#1180</a></li> <li>Dependency updates by <a href="https://github.com/dependabot"><code>@dependabot</code></a>- <a href="https://redirect.github.com/actions/checkout/pull/1777">actions/checkout#1777</a>, <a href="https://redirect.github.com/actions/checkout/pull/1872">actions/checkout#1872</a></li> </ul> <h2>v4.1.7</h2> <ul> <li>Bump the minor-npm-dependencies group across 1 directory with 4 updates by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1739">actions/checkout#1739</a></li> <li>Bump actions/checkout from 3 to 4 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1697">actions/checkout#1697</a></li> <li>Check out other refs/* by commit by <a href="https://github.com/orhantoy"><code>@orhantoy</code></a> in <a href="https://redirect.github.com/actions/checkout/pull/1774">actions/checkout#1774</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions/checkout/commit/df4cb1c069e1874edd31b4311f1884172cec0e10"><code>df4cb1c</code></a> Update changelog for v6.0.3 (<a href="https://redirect.github.com/actions/checkout/issues/2446">#2446</a>)</li> <li><a href="https://github.com/actions/checkout/commit/1cce3390c2bfda521930d01229c073c7ff920824"><code>1cce339</code></a> Fix checkout init for SHA-256 repositories (<a href="https://redirect.github.com/actions/checkout/issues/2439">#2439</a>)</li> <li><a href="https://github.com/actions/checkout/commit/900f2210b1d28bbbd0bd22d17926b9e224e8f231"><code>900f221</code></a> fix: expand merge commit SHA regex and add SHA-256 test cases (<a href="https://redirect.github.com/actions/checkout/issues/2414">#2414</a>)</li> <li><a href="https://github.com/actions/checkout/commit/0c366fd6a839edf440554fa01a7085ccba70ac98"><code>0c366fd</code></a> Update changelog (<a href="https://redirect.github.com/actions/checkout/issues/2357">#2357</a>)</li> <li>See full diff in <a href="https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd...df4cb1c069e1874edd31b4311f1884172cec0e10">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
## Summary Bumps the dev-dependencies group with 16 updates, including ESLint 10 and TypeScript 6, and adds the minimal follow-up fixes needed to keep CI green after the upgrade. In particular, this PR: - updates the dev dependency set from the original Renovate change - makes the workspace package `tsconfig.json` files compatible with TypeScript 6 by setting explicit `rootDir` values and enabling the required disposable libs for `Symbol.asyncDispose` - makes the ClickHouse Cloud schema/deployment examples skip cleanly when cloud credentials are not provided, so the examples CI jobs do not fail in environments without `CLICKHOUSE_CLOUD_URL` / `CLICKHOUSE_CLOUD_PASSWORD` Human-readable CHANGELOG note: - Build/examples: make the workspace packages compatible with TypeScript 6 and skip ClickHouse Cloud examples when cloud credentials are unavailable in CI. ## Checklist - [ ] Unit and integration tests covering the common scenarios were added - [x] A human-readable description of the changes was provided to include in CHANGELOG - [ ] For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Peter Leonov <peter.leonov@clickhouse.com>
## Summary Stick to the industry defaults as LLMs produce the code. Otherwise any code that comes in needs to be reformatted, especially subtrees from other repos.
Bumps the dev-dependencies group with 2 updates: [prettier](https://github.com/prettier/prettier) and [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint). Updates `prettier` from 3.8.3 to 3.8.4 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/prettier/prettier/releases">prettier's releases</a>.</em></p> <blockquote> <h2>3.8.4</h2> <ul> <li>Markdown: Fix blank lines between list items and nested sub-lists being removed in Markdown/MDX (<a href="https://redirect.github.com/prettier/prettier/pull/17746">prettier/prettier#17746</a> by <a href="https://github.com/byplayer"><code>@byplayer</code></a>)</li> </ul> <p>🔗 <a href="https://github.com/prettier/prettier/blob/3.8.4/CHANGELOG.md#384">Changelog</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/prettier/prettier/blob/main/CHANGELOG.md">prettier's changelog</a>.</em></p> <blockquote> <h1>3.8.4</h1> <p><a href="https://github.com/prettier/prettier/compare/3.8.3...3.8.4">diff</a></p> <h4>Markdown: Fix blank lines between list items and nested sub-lists being removed in Markdown/MDX (<a href="https://redirect.github.com/prettier/prettier/pull/17746">#17746</a> by <a href="https://github.com/byplayer"><code>@byplayer</code></a>)</h4> <p>Prettier was removing blank lines between list items and their nested sub-lists, converting loose lists into tight lists and changing their semantic meaning.</p> <!-- raw HTML omitted --> <pre lang="markdown"><code><!-- Input --> - a <ul> <li> <p>b</p> </li> <li> <p>c</p> <ul> <li>d</li> </ul> </li> </ul> <p><!-- Prettier 3.8.3 --></p> <ul> <li>a <ul> <li>b</li> </ul> </li> <li>c <ul> <li>d</li> </ul> </li> </ul> <p><!-- Prettier 3.8.4 --></p> <ul> <li> <p>a</p> <ul> <li>b</li> </ul> </li> <li> <p>c</p> <ul> <li>d<br /> </code></pre></li> </ul> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/prettier/prettier/commit/1c6ba5539141552e0e8e22d401ea620d8fdff468"><code>1c6ba55</code></a> Release 3.8.4</li> <li><a href="https://github.com/prettier/prettier/commit/4a673dc9b59ddf7296bbab9822093d2971da84a8"><code>4a673dc</code></a> Fix blank lines between list items and nested sub-lists being removed in Mark...</li> <li><a href="https://github.com/prettier/prettier/commit/074aaedbb052a288e89d15eb0a4214de37a08866"><code>074aaed</code></a> Replace <code>main</code> branch in changelog link with tags (<a href="https://redirect.github.com/prettier/prettier/issues/19054">#19054</a>)</li> <li><a href="https://github.com/prettier/prettier/commit/c22a003ae97917c5043e8685b4fdff0f93e978f9"><code>c22a003</code></a> Bump Prettier dependency to 3.8.3</li> <li><a href="https://github.com/prettier/prettier/commit/07bad1f04536e9799927007baf466e67151576f0"><code>07bad1f</code></a> Clean changelog_unreleased</li> <li>See full diff in <a href="https://github.com/prettier/prettier/compare/3.8.3...3.8.4">compare view</a></li> </ul> </details> <br /> Updates `typescript-eslint` from 8.60.1 to 8.61.0 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/typescript-eslint/typescript-eslint/releases">typescript-eslint's releases</a>.</em></p> <blockquote> <h2>v8.61.0</h2> <h2>8.61.0 (2026-06-08)</h2> <h3>🚀 Features</h3> <ul> <li><strong>ast-spec:</strong> change type of <code>UnaryExpression.prefix</code> to always <code>true</code> (<a href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12372">#12372</a>)</li> <li><strong>ast-spec:</strong> tighten types of <code>ArrowFunction</code>, <code>YieldExpression</code>, <code>TSTypePredicate</code> (<a href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12373">#12373</a>)</li> </ul> <h3>🩹 Fixes</h3> <ul> <li><strong>rule-schema-to-typescript-types:</strong> respect ECMAScript line terminators (<a href="https://redirect.github.com/typescript-eslint/typescript-eslint/pull/12374">#12374</a>)</li> </ul> <h3>❤️ Thank You</h3> <ul> <li>Kirk Waiblinger <a href="https://github.com/kirkwaiblinger"><code>@kirkwaiblinger</code></a></li> <li>lumir</li> </ul> <p>See <a href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.61.0">GitHub Releases</a> for more information.</p> <p>You can read about our <a href="https://typescript-eslint.io/users/versioning">versioning strategy</a> and <a href="https://typescript-eslint.io/users/releases">releases</a> on our website.</p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md">typescript-eslint's changelog</a>.</em></p> <blockquote> <h2>8.61.0 (2026-06-08)</h2> <p>This was a version bump only for typescript-eslint to align it with other projects, there were no code changes.</p> <p>See <a href="https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.61.0">GitHub Releases</a> for more information.</p> <p>You can read about our <a href="https://typescript-eslint.io/users/versioning">versioning strategy</a> and <a href="https://typescript-eslint.io/users/releases">releases</a> on our website.</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/typescript-eslint/typescript-eslint/commit/16a5b247affc32af21b695cf96dfd75d7ded50a3"><code>16a5b24</code></a> chore(release): publish 8.61.0</li> <li>See full diff in <a href="https://github.com/typescript-eslint/typescript-eslint/commits/v8.61.0/packages/typescript-eslint">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
## Summary
Only `wait_end_of_query`, `default_format`, `session_timeout`, and
`session_check` were typed in `ClickHouseHTTPSettings`. This adds the
remaining HTTP-handler params from ClickHouse's `reserved_param_names`
so they surface in autocomplete when passed via `clickhouse_settings`.
- **`packages/client-common/src/settings.ts`** — Added `buffer_size`,
`compress`, `decompress`, `quota_key`, and `stacktrace` to
`ClickHouseHTTPSettings`, each with JSDoc. Deliberately omitted `user`,
`password`, `query_id`, `session_id`, and `database`, which are already
first-class client config / query params (the first two being
credentials).
- **`to_search_params.test.ts`** — Added a unit test asserting the new
settings serialize into the request URL.
- **`CHANGELOG.md`** — Added an Improvements entry.
```ts
await client.query({
query: "SELECT 1",
clickhouse_settings: {
// buffer the entire response server-side before sending to the client
wait_end_of_query: 1,
buffer_size: "1048576",
},
});
```
These are additive type declarations only; the settings already worked
at runtime via the `Record<string, ...>` index signature on
`ClickHouseSettings`.
Fixes #53.
## Checklist
- [x] Unit and integration tests covering the common scenarios were
added
- [x] A human-readable description of the changes was provided to
include in CHANGELOG
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
## Summary Bumps `codecov/codecov-action` from v5.5.2 to v6.0.2 (latest 6.x), pinned to commit SHA `fb8b3582c8e4def4969c97caa2f19720cb33a72f`. - Updated `.github/workflows/tests-node.yml` - Updated `.github/workflows/tests-web.yml` Note: v6.0.0+ runs on the `node24` runtime. ## Checklist - [ ] A human-readable description of the changes was provided to include in CHANGELOG Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
…tion (#823) ## Summary TypeScript 6.0 is a transition release: options it deprecates are **removed entirely in TypeScript 7.0** (the native port). This aligns the repo's tsconfigs with the TS 6.0 "Breaking Changes and Deprecations" / "Preparing for TypeScript 7.0" guidance so the upgrade is a no-op. - **Removed deprecated `baseUrl`** in `tsconfig.dev.json` and `benchmarks/tsconfig.json` (the only 7.0-breaking option present), folding the prefix into each `paths` entry. - **Explicit `types: []`** in `client-common`/`client-web` tsconfigs — matches the new 6.0 default and the recommendation to pin `types` for predictability/perf (neither package's `src` uses Node globals). - **Pinned new 6.0 defaults** in `tsconfig.base.json`: `noUncheckedSideEffectImports: true` and `libReplacement: false`, so behavior doesn't ride on floating defaults. Already compliant, left as-is: `strict`, `esModuleInterop`, `NodeNext` module/resolution, explicit `target`/`rootDir`, `erasableSyntaxOnly`; no `outFile`/`downlevelIteration`, legacy `module` namespaces, or `asserts` import attributes. ```diff { "compilerOptions": { - "baseUrl": "./", "paths": { - "@clickhouse/client-common": ["packages/client-common/src/index.ts"] + "@clickhouse/client-common": ["./packages/client-common/src/index.ts"] } } } ``` ## Checklist - [x] A human-readable description of the changes was provided to include in CHANGELOG - Aligned tsconfigs with TypeScript 6.0 defaults and removed the deprecated `baseUrl` option to prepare for the TypeScript 7.0 (native) migration. Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
## Summary
Verifies the client can transmit every setting the server supports,
replacing the `// TODO: cover at least all enum settings` placeholder in
`clickhouse_settings.test.ts`.
The new test reads all settings from `system.settings` and sends each
one back at its current value, asserting none is rejected. Iterating
over what the server reports means enum settings, `Map` settings, and
any settings added in future server versions are covered automatically
across the CI version matrix.
Follow-up fixes from review/CI feedback are included:
- bounded worker count with `Math.min(10, settings.length)`
- removed the inline type assertion in favor of a typed variable
- fixed worker loop runtime error by restoring the shared `index`
counter (`let index = 0`)
- **Test scope**: limited to `LocalSingleNode` / `LocalCluster` (every
setting is writable there), so the assertion can be strict; Cloud is
skipped because its read-only setting constraints would reject
same-value sends.
- **Execution**: 10-way concurrency keeps the ~1.6k single-statement
requests well under a second.
```ts
const settings = await client
.query({ query: "SELECT name, value FROM system.settings", format: "JSONEachRow" })
.then((r) => r.json<{ name: string; value: string }>());
let index = 0;
const clickhouse_settings: ClickHouseSettings = { [name]: value };
await client.command({
query: "SELECT 1",
clickhouse_settings,
});
```
> Note: while building this, two stale enum unions surfaced against
ClickHouse 26.6 — `Dialect` (invalid `kusto_auto`, missing
`polyglot`/`promql`) and `ORCCompression` (`gzip` should be `zlib`).
These are left unchanged here since they are version-sensitive and out
of scope for this test-only change.
## Checklist
- [x] Unit and integration tests covering the common scenarios were
added
- [ ] A human-readable description of the changes was provided to
include in CHANGELOG
- [ ] For significant changes, documentation in
https://github.com/ClickHouse/clickhouse-docs was updated with further
explanations or tutorials
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Peter Leonov <peter.leonov@clickhouse.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
## Summary In cluster mode the server wraps the original exception, repeating the `Code`/`Exception`/`(TYPE)` markers: ``` Code: 57. DB::Exception: There was an error on [clickhouse2:9000]: Code: 57. DB::Exception: Table default.t already exists. (TABLE_ALREADY_EXISTS) (version ...). (TABLE_ALREADY_EXISTS) (version ...) ``` The old greedy regex captured the repeated `(TYPE)` / `(version ...)` suffixes into `message`, yielding garbage instead of `Table default.t already exists.`. Changes in `packages/client-common/src/error/error.ts`: - **`errorRe`** — greedy `.*Exception: ` anchors on the innermost exception; lazy `(?<message>.+?)` stops at the first `(TYPE)` marker instead of swallowing the wrapper suffixes. - **Type lookahead** — requires ≥3 consecutive uppercase letters, so parenthesised groups like `(2)` or `(official build)` are not mistaken for the error type (preserves the `TOO_FEW_LIVE_REPLICAS` corner case). - **Note on ReDoS** — documented that error strings are never freeform; the format is rigid and server-controlled, never attacker-supplied, so greedy matching is safe here and the theoretical backtracking cost is not a real concern. - Enabled the previously `describe.skip`'d "Cluster mode errors" unit test. ## Checklist - [x] Unit and integration tests covering the common scenarios were added - [x] A human-readable description of the changes was provided to include in CHANGELOG CHANGELOG: `parseError` now correctly extracts message, code, and type from nested exceptions returned by the server in cluster mode. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Peter Leonov <peter.leonov@clickhouse.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…#826) ## Summary Makes updating `CHANGELOG.md` a same-PR requirement rather than something deferred to release time, and teaches the Copilot review agent to enforce it. - **`AGENTS.md`** (*API quality and stability*): the CHANGELOG step is now mandatory in the same PR, with explicit formatting rules — top-most version heading (or a new `# x.y.z` heading matching the unreleased `package.json` version when the latest is already tagged), lowercase section headings (`## New features` / `## Improvements` / `## Bug fixes`), a `([#n])` PR reference link, platform scoping (Node.js-/Web-only), and a prettier pass. - **`.github/instructions/review.instructions.md`**: instructs the review agent to flag any feature/bugfix/behavior PR that doesn't touch `CHANGELOG.md` (a PR-description note is not sufficient) and to verify the entry follows the conventions. Pure refactors/tests/docs/CI are exempt. Split out of #825, where this guidance was first drafted. ## Checklist - [ ] Unit and integration tests covering the common scenarios were added - [x] A human-readable description of the changes was provided to include in CHANGELOG - [ ] For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…584) (#825) ## Summary This is a rebase of #584 onto current `main` to resolve the merge conflicts that arose after the `default_prettier` reformatting and the `node_base_connection` socket-pool refactor landed. All credit for the implementation goes to @jzila — the original commits are preserved as-authored. This PR only rebases them onto `main` and normalizes formatting to the repo's current Prettier config. See the original PR #584 for the full discussion and review history. ### Original description (from #584) - Adds a `use_multipart_params` client config option (default: `false`) that sends query parameters as `multipart/form-data` parts instead of URL query string entries - When enabled, `query()` moves the SQL into a `query` multipart part and each `param_*` entry into its own named part, avoiding URL length limits that cause HTTP 400 on ClickHouse Cloud with large arrays (25K+ values) - Uses the multipart format supported by ClickHouse since ClickHouse/ClickHouse#40055 - A per-request `use_multipart_params` override is also supported on `BaseQueryParams` - All non-param URL search params (database, query_id, settings, session_id, role) remain in the URL as-is ## Test plan - [x] `buildMultipartBody()` unit tests (client-common) - [x] Connection-level multipart unit tests (client-node) - [x] All common unit tests pass (63 in the multipart/config suites verified locally) - [x] All Node.js unit tests pass (134 passed / 4 skipped locally) - [ ] Web unit tests (require a browser runner; not run locally) Closes #584 if merged here, or alternatively the rebased commits can be pulled back into the original fork branch. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: John Zila <john@jzila.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
## Summary Ingesting: - #350 Use the `X-ClickHouse-Exception-Code` header (ClickHouse/ClickHouse#8786) to detect ClickHouse errors even when the HTTP status is successful. Previously, such 200 responses were treated as successful and the exception text could surface as malformed result data; now the request is rejected with a parsed `ClickHouseError`, consistent with non-2xx error responses. Related issue: #332 (similar issue can happen with inserts). Changes: - **Node.js client** (`socket_pool.ts`): a response is treated as failed when the `x-clickhouse-exception-code` header is present, even with a 2xx status. - **Web client** (`web_connection.ts`): a 2xx `fetch` response with the header set is rejected via the existing `parseError` path. - **Unit tests**: in both flavors simulating a 200 response with `X-ClickHouse-Exception-Code: 395` and an exception body — Node via a local `http.Server`, Web via a mocked `fetch` injected through the client config; assert `query`/`insert`/`command`/`exec` all reject with a `ClickHouseError` (proper `code`, `type`, `message`). - **Integration test** (`packages/client-common/__tests__/integration/exception_header.test.ts`): runs against a real ClickHouse server using `send_progress_in_http_headers: 1` and `http_headers_progress_interval_ms: '100'` to reproduce the exact scenario where ClickHouse commits to HTTP 200 before an exception fires (via `throwIf` at row 10 with `sleepEachRow` and `max_block_size = 1`), then asserts the client rejects with a `ClickHouseError` carrying `code: '395'`. The test lives in `client-common` so it runs under both the Node.js and Web vitest configurations. - **CHANGELOG**: added a `1.21.0` Bug Fixes entry. ## Checklist - [x] Unit and integration tests covering the common scenarios were added - [x] A human-readable description of the changes was provided to include in CHANGELOG --------- Co-authored-by: Cheskel Twersky <twerskycheskel@gmail.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
…nterface (#782) ## Summary Adds an optional `tracer` config option that traces the client's lifecycle operations (`query` / `command` / `exec` / `insert` / `ping`) with a **zero-dependency** interface that is a structural subset of the OpenTelemetry `Tracer`/`Span` APIs — a raw `trace.getTracer(...)` is assignable as-is, no adapter, no casts. This iteration redesigns the surface per review feedback: `startActiveSpan()` instead of the `startSpan` + `withActiveSpan` hack, and a no-op *tracer* (not just a no-op span) assigned once at client creation. ### Interface - `ClickHouseTracer` now has a single method: `startActiveSpan(name, options, fn)` — same shape as OTEL's `Tracer.startActiveSpan(name, options, fn)` overload (assignability re-verified via `tsc` against `@opentelemetry/api`). - The optional `withActiveSpan` scope hack is removed. Active-span propagation across the operation's `await` points requires OTEL's `AsyncLocalStorageContextManager` — the default in the Node OTEL SDK. Documented in the `ClickHouseTracer` / config JSDoc and `docs/howto/tracing.md`. - Also adds a new `use_multipart_params` config option (merged from `main`) that sends `query_params` as `multipart/form-data` parts instead of URL query string entries, avoiding HTTP URL length limits for large query parameters. ### Hot path - `NoopClickHouseSpan` is superseded by `NoopClickHouseTracer` (which hands out `NoopClickHouseSpan`); the client assigns `config.tracer ?? NoopClickHouseTracer` once in the constructor, keeping call sites branch-free and monomorphic for the JIT. - `recordSpanError()` kept, moved next to the types in `client-common/src/tracing.ts`. - Tracing stays imperative and repetitive per method (golang style) — no decorators, no shared wrappers. Tracer/span exceptions are intentionally not caught. ### Spans Each operation emits one `CLIENT`-kind span (`clickhouse.query`, `clickhouse.insert`, …) with OTEL semantic-convention attributes (`db.system`, `db.namespace`, `server.address`) plus operation specifics (`clickhouse.query_id` — including server-assigned ids, `clickhouse.table`, `clickhouse.format`, `clickhouse.session_id`), OK/ERROR status, `recordException` on failure, `end()` in `finally`. ```ts import { createClient } from "@clickhouse/client"; import { trace } from "@opentelemetry/api"; // raw OTEL tracer, no adapter; spans become active across awaits when // AsyncLocalStorageContextManager is registered (Node OTEL SDK default) const client = createClient({ url: "http://localhost:8123", tracer: trace.getTracer("@clickhouse/client"), }); ``` ### Docs & example - `docs/howto/tracing.md`: full surface description, context-manager requirement, recording-tracer recipe. - `examples/node/coding/otel_tracing.ts`: runnable example passing the raw OTEL tracer directly, registering `AsyncLocalStorageContextManager` for a bare `BasicTracerProvider` (excluded from examples CI until the release ships). ## Checklist - [x] Unit and integration tests covering the common scenarios were added - [x] A human-readable description of the changes was provided to include in CHANGELOG --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Peter Leonov <peter.leonov@clickhouse.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…s to multipart (#827) ## Summary Large `query_params` are URL-encoded into the request line, where HTTP intermediaries (nginx, AWS ALB, CloudFront) reject them with 414/400. This adds an opt-in `use_multipart_params_auto` setting (client config + per-request override, default `false`) that automatically sends `query_params` as a `multipart/form-data` body — same mechanism as `use_multipart_params` — but only when their URL-encoded length exceeds `MAX_URL_BIND_PARAM_LENGTH` (4096). `use_multipart_params` semantics are unchanged, preserving full backwards compatibility. - **`serializeQueryParamsForUrl` (client-common)** — early-return copy of the `param_*` serializer: returns the serialized URL entries, or `null` as soon as the budget is exceeded (raw-length lower bound short-circuits before the exact encoded-length check). This makes the promotion decision without serializing params twice. - **`toSearchParams`** — accepts optional pre-serialized `param_entries`; in that path it now reuses the same entries array and appends `query_id` directly (instead of spread-copying), while the default `query_params` serialization path remains unchanged. - **Node & web connections** — in auto mode, params are serialized once: `null` → multipart body, otherwise the entries are handed straight to `toSearchParams`. Forced `use_multipart_params` behaves as before. (Per-connection duplication is intentional per repo conventions.) - **Tests** — unit coverage for threshold behavior (percent-encoding expansion, non-string params, exact boundary) plus integration tests for forced and auto multipart round-trips. ```ts const client = createClient({ use_multipart_params_auto: true }) // small params → URL as usual; oversized params → multipart body, no 414 await client.query({ query: 'SELECT * FROM t WHERE id IN {ids:Array(String)}', query_params: { ids: hugeArray }, format: 'JSONEachRow', }) ``` ## Checklist - [x] Unit and integration tests covering the common scenarios were added - [x] A human-readable description of the changes was provided to include in CHANGELOG - [ ] For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Peter Leonov <peter.leonov@clickhouse.com>
## Summary Makes a TypeScript LSP discoverable and usable by AI agent runs in this repo, per the request to install `typescript-language-server`, test it, and commit the enabling changes. The server was verified end-to-end over stdio (JSON-RPC) from the repo root against `packages/client-common/src/client.ts`: - `textDocument/hover` — full inferred signature + JSDoc for `ClickHouseClient.query` - `textDocument/definition`, `textDocument/references` - `workspace/symbol` — finds `ClickHouseClient` class + re-exports across packages - `textDocument/completion` - Diagnostics arrive via push (`textDocument/publishDiagnostics`); pull `textDocument/diagnostic` is unsupported (`-32601`) — documented as a caveat It uses the workspace-local `typescript@6.x` and picks up each workspace's `tsconfig.json` automatically; no extra configuration needed. Changes: - **Dependency** — `typescript-language-server@^5.3.0` added as a root devDependency, so the existing `setup` skill (`npm install`) makes it available via `npx typescript-language-server --stdio` - **Skill** — new `.claude/skills/typescript-lsp/SKILL.md` with the startup command, protocol essentials (0-based positions, `didOpen` requirement), verified capability matrix, and the push-only diagnostics caveat - **AGENTS.md** — new "Code intelligence (TypeScript LSP)" section pointing agents at the skill and recommending the LSP over text search for symbol resolution The skill is repo-internal, so it is intentionally **not** added to the shipped `agents.skills` array in `packages/client-node/package.json` (checked by the Skills E2E workflow). No production code changed. ## Checklist - [x] A human-readable description of the changes was provided to include in CHANGELOG (N/A — tooling/docs only, no observable client behavior change) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
…ifecycle into ResultSet (#828) ## Summary Aligns the tracer API (unreleased, introduced in #776) with the <a href="https://opentelemetry.io/docs/specs/semconv/db/sql/">OpenTelemetry database semantic conventions</a> and matches the attribute vocabulary of the Rust client (<a href="https://github.com/ClickHouse/clickhouse-rs">clickhouse-rs</a>). The `QuerySpanTracker` indirection is removed — `ResultSet` implementations now receive the raw `ClickHouseSpan` and finalize it directly. - **`client-common`** - Removed the `QuerySpanTracker` class (unreleased API) and its export; exported `recordSpanError` instead for the result sets. - `MakeResultSet` now takes `span?: ClickHouseSpan`; `client.query()` hands the span to `makeResultSet` and records/ends it itself if `makeResultSet` throws. - Simplified `client.ping()` to forward the existing immutable params object directly instead of cloning it first. - `recordSpanError` now coerces `ClickHouseError.code` to a number when it is numeric, so `clickhouse.error.code` is consistently typed as a number in OTEL backends. - **Span attribute alignment** - Spans now carry `db.system.name` (instead of `db.system`), `server.address` + `server.port` (instead of a combined `host:port`), `clickhouse.request.query_id` / `clickhouse.request.session_id` (instead of `clickhouse.query_id` / `clickhouse.session_id`), `clickhouse.response.format` on `query` and `clickhouse.request.format` on `insert` (instead of `clickhouse.format`), and `db.operation.name` + `db.collection.name` on `insert` (instead of `clickhouse.table`). - The span status is left unset on success (per the OTEL spec recommendation for client spans, previously set to `OK`); on failure, the span gets the `error.type` attribute (the error class name) and, for server-side errors, `clickhouse.error.code` (the numeric ClickHouse error code). - Spans record response-side attributes: `db.response.status_code` (HTTP status) and, when the `X-ClickHouse-Summary` header is available, `clickhouse.summary.*` counters (`read_rows`, `written_rows`, etc.). - The `insert` span records `clickhouse.request.sent_rows` for array-based inserts. - **Two-span model for `query()`** (deviates from clickhouse-rs; makes request duration and stream duration independently observable) - `clickhouse.query` ends as soon as the HTTP response headers are received. - A child `clickhouse.query.stream` span is started immediately after and handed to the `ResultSet`; it ends with `clickhouse.response.decoded_bytes` (and `db.response.returned_rows` for row-streaming paths) when the result set is fully consumed, closed, or fails. This separation makes it easy to distinguish the original request round-trip from a stream that may never end (e.g. tailing a live materialized view). - **Node & Web `ResultSet`** (duplicated per the node/web convention) - Each tracks `span_bytes` / `span_rows` internally and finalizes via a private `finishSpan(err?)`: records `clickhouse.response.decoded_bytes` (+ `db.response.returned_rows` when rows were counted), records the error if any, and ends the span exactly once on full consumption, `close()`, or failure. - Node `ResultSet.close()` destroys the underlying stream (it is not marked as consumed); a clarifying comment explains why setting `_consumed` there would produce a misleading "already consumed" error when the stream was actually destroyed. - Web `ResultSet.text()` and the non-streamable `json()` path record `clickhouse.response.text_length` (UTF-16 code-unit count of the response body) instead of `clickhouse.response.decoded_bytes`, avoiding the `TextEncoder` allocation that accurate byte counting would require; a comment in each explains the distinction. - **Web `ResultSet` span leak fix** - In `ResultSet.stream()`, the `TransformStream` transformer now includes a `cancel(reason?)` callback. Per the WHATWG Streams spec, `cancel` is called both when the consumer cancels the readable side and when the writable side is aborted (e.g. source stream network error), ensuring `clickhouse.query.stream` is always ended even on network failures. - Added `return` after `controller.error(err)` in the exception-tag branch to stop further processing once the stream is errored. - **Tests & docs** - `node_result_set_span.test.ts` passes the span directly; all span-lifecycle scenarios unchanged. - `tracing.test.ts`: updated for the two-span query lifecycle; tracker-specific tests replaced with span-handoff and `makeResultSet`-throw coverage. - Removed the no-longer-needed `OTEL.md` planning document and its remaining repository reference. - Removed `trace_context_propagator` / `injectTraceContext` (traceparent propagation is left to HTTP auto-instrumentation). ## Checklist - [x] Unit and integration tests covering the common scenarios were added - [x] A human-readable description of the changes was provided to include in CHANGELOG - [ ] For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Peter Leonov <peter.leonov@clickhouse.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
A short description of the changes with a link to an open issue.
Checklist
Delete items not relevant to your PR: