Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
3fea961
Disable @typescript-eslint/ban-ts-comment globally (#808)
Copilot Jun 4, 2026
63b17fe
Enable additional TypeScript strictness flags (excluding exactOptiona…
Copilot Jun 4, 2026
0f17ce0
chore: bump version to 1.21.0 (#809)
github-actions[bot] Jun 4, 2026
ceb8d82
Make TypeScript sources compatible with --erasableSyntaxOnly (#768)
Copilot Jun 10, 2026
c7942ce
Bump actions/checkout from 6.0.2 to 6.0.3 in /.github/workflows (#815)
dependabot[bot] Jun 10, 2026
1508837
Bump dev dependencies and fix TypeScript 6/examples CI (#816)
dependabot[bot] Jun 10, 2026
1806c5e
Use default prettier settings (#810)
peter-leonov-ch Jun 10, 2026
6aacc08
Bump the dev-dependencies group with 2 updates (#818)
dependabot[bot] Jun 10, 2026
1564b16
Add typings for the remaining HTTP-specific ClickHouse settings (#821)
Copilot Jun 10, 2026
e19237b
ci: bump codecov/codecov-action to v6.0.2 (#824)
Copilot Jun 10, 2026
0ba4dee
Adopt TypeScript 6.0 options to prepare for the TS 7.0 (native) migra…
Copilot Jun 10, 2026
4b93a35
Add integration test covering every ClickHouse setting (#820)
Copilot Jun 10, 2026
82676f9
Fix error parsing for cluster-mode nested exceptions (#819)
Copilot Jun 10, 2026
8f1b779
Require CHANGELOG updates in-PR (contributor + review-agent guidance)…
peter-leonov-ch Jun 10, 2026
2353dcb
Add use_multipart_params option for large query parameters (rebase of…
peter-leonov-ch Jun 10, 2026
62fca64
fix: check the X-ClickHouse-Exception-Code for error code (#554)
peter-leonov-ch Jun 10, 2026
30c8af1
Add zero-dependency tracer API with OTEL-compatible startActiveSpan i…
Copilot Jun 10, 2026
6d2edce
Add `use_multipart_params_auto` to auto-promote oversized query param…
Copilot Jun 12, 2026
22f379f
Add typescript-language-server for agent code intelligence (#829)
Copilot Jun 12, 2026
448e788
Align OTEL tracer API with DB semantic conventions; move query span l…
Copilot Jun 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
64 changes: 64 additions & 0 deletions .claude/skills/typescript-lsp/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
name: typescript-lsp
description: >
Use the TypeScript language server (`typescript-language-server`) for precise
code intelligence in the `clickhouse-js` repository: go-to-definition, find
references, hover (type signatures and JSDoc, including `@deprecated` info),
workspace-wide symbol search, completions, and per-file type diagnostics.
Prefer this over grep when you need to resolve a symbol's actual definition,
find all usages of an exported API, or inspect inferred types across the
`packages/*` workspaces. The server is preinstalled as a root devDependency —
run the repository `setup` skill (`npm install`) first so `node_modules` is
populated. Do NOT use this skill for downstream projects that merely depend
on `@clickhouse/client`; it is specific to working inside this repo.
---

# TypeScript Language Server in clickhouse-js

`typescript-language-server` is declared as a root devDependency, so after
`npm install` (see the `setup` skill) it is available via `npx` and uses the
workspace-local `typescript` (6.x) compiler, matching CI exactly.

## Starting the server

From the repo root:

```bash
npx typescript-language-server --stdio
```

It speaks LSP (JSON-RPC, `Content-Length`-framed) over stdio. There is no
extra configuration: each `packages/*` workspace, `tests/clickhouse-test-runner`,
`examples/node`, and `examples/web` has its own `tsconfig.json`, and the
server picks the nearest one per opened file automatically.

## Protocol essentials

1. Send `initialize` with `rootUri`/`workspaceFolders` pointing at the repo
root, then the `initialized` notification.
2. Send `textDocument/didOpen` with the full file text for every file you
want to query (the server reads dependencies from disk on its own; only
files you query positions in need to be opened).
3. Positions are **0-based** (line and character).

## Verified capabilities (typescript-language-server 5.x, TS 6.x)

| Request | Notes |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `textDocument/hover` | Returns the full inferred signature + JSDoc markdown |
| `textDocument/definition` | Resolves across workspace packages via source, not `dist/` |
| `textDocument/references` | Within the opened file's project |
| `workspace/symbol` | e.g. query `ClickHouseClient` finds class + re-exports |
| `textDocument/completion` | Context-aware member completions |
| Diagnostics | **Push only** (`textDocument/publishDiagnostics` notifications, sent ~1–3s after `didOpen`). The pull `textDocument/diagnostic` request is _not_ supported (`-32601`) — wait for the push notification instead. |

## Tips

- If your environment provides built-in LSP/code-intelligence tooling, point
it at `npx typescript-language-server --stdio` with the repo root as the
workspace folder.
- For one-off scripted queries, spawn the server from Node, frame messages
with `Content-Length: <bytes>\r\n\r\n<json>`, and match responses by `id`.
- A full workspace typecheck is still `npm run build && npm run typecheck`
(build first — some workspaces import compiled `dist/` outputs); the LSP is
for targeted, interactive queries, not for CI-equivalent validation.
11 changes: 11 additions & 0 deletions .docker/clickhouse/cluster/server1_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@
<flush_interval_milliseconds>1000</flush_interval_milliseconds>
</query_log>

<opentelemetry_span_log>
<database>system</database>
<table>opentelemetry_span_log</table>
<engine>
ENGINE = MergeTree
PARTITION BY finish_date
ORDER BY (finish_date, finish_time_us)
</engine>
<flush_interval_milliseconds>1000</flush_interval_milliseconds>
</opentelemetry_span_log>

<http_options_response>
<header>
<name>Access-Control-Allow-Origin</name>
Expand Down
11 changes: 11 additions & 0 deletions .docker/clickhouse/cluster/server2_config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@
<flush_interval_milliseconds>1000</flush_interval_milliseconds>
</query_log>

<opentelemetry_span_log>
<database>system</database>
<table>opentelemetry_span_log</table>
<engine>
ENGINE = MergeTree
PARTITION BY finish_date
ORDER BY (finish_date, finish_time_us)
</engine>
<flush_interval_milliseconds>1000</flush_interval_milliseconds>
</opentelemetry_span_log>

<http_options_response>
<header>
<name>Access-Control-Allow-Origin</name>
Expand Down
11 changes: 11 additions & 0 deletions .docker/clickhouse/single_node/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@
<flush_interval_milliseconds>1000</flush_interval_milliseconds>
</query_log>

<opentelemetry_span_log>
<database>system</database>
<table>opentelemetry_span_log</table>
<engine>
ENGINE = MergeTree
PARTITION BY finish_date
ORDER BY (finish_date, finish_time_us)
</engine>
<flush_interval_milliseconds>1000</flush_interval_milliseconds>
</opentelemetry_span_log>

<http_options_response>
<header>
<name>Access-Control-Allow-Origin</name>
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
title: ""
labels: bug
assignees: ''
assignees: ""
---

<!-- delete unnecessary items -->
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Feature request
about: Suggest an idea for the client
title: ''
title: ""
labels: enhancement
assignees: ''
assignees: ""
---

<!-- delete unnecessary items -->
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Question
about: Ask a question about the client
title: ''
title: ""
labels: question
assignees: ''
assignees: ""
---

> Make sure to check the [documentation](https://clickhouse.com/docs/en/integrations/language-clients/javascript) first.
Expand Down
32 changes: 16 additions & 16 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '.github/workflows'
- package-ecosystem: "github-actions"
directory: ".github/workflows"
schedule:
interval: 'weekly'
day: 'monday'
interval: "weekly"
day: "monday"
groups:
workflows:
dependency-type: 'development'
- package-ecosystem: 'npm'
directory: '/'
dependency-type: "development"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: 'weekly'
day: 'monday'
interval: "weekly"
day: "monday"
groups:
dev-dependencies:
dependency-type: 'development'
dependency-type: "development"
ignore:
- dependency-name: '@opentelemetry/auto-instrumentations-node'
versions: ['0.70.0']
- dependency-name: '@types/node'
versions: ['25.3.0']
- dependency-name: 'typescript-eslint'
versions: ['8.56.0']
- dependency-name: "@opentelemetry/auto-instrumentations-node"
versions: ["0.70.0"]
- dependency-name: "@types/node"
versions: ["25.3.0"]
- dependency-name: "typescript-eslint"
versions: ["8.56.0"]
4 changes: 4 additions & 0 deletions .github/instructions/review.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ In other cases when you've found a meaningful change to make, make it and push c

When reviewing PRs to the `release` branch focus on flagging breaking changes and security issues in the broader context, as PRs to the `release` branch are normally bigger and include a cumulative change from a number of PRs.

## CHANGELOG

Every PR that adds a feature, fixes a bug, or changes observable behavior or the public API **must update `CHANGELOG.md` in the same PR**. If such a change does not touch `CHANGELOG.md`, flag it and ask the author to add an entry (a note in the PR description alone is not sufficient). Verify the entry follows the conventions in [`AGENTS.md`](../../AGENTS.md) ("API quality and stability"): placed under the top-most version heading (a new `# x.y.z` heading matching the unreleased `package.json` version when the latest heading is already released), grouped under a lowercase section heading (`## New features` / `## Improvements` / `## Bug fixes`), and ending with a `([#<n>])` PR reference link. Pure refactors, test-only changes, docs, and CI/tooling changes do not require a CHANGELOG entry.

## Breaking changes

Always flag major breaking changes to the public API (removed/renamed exports, changed function signatures, changed default behavior, removed configuration options, etc.) when they are not accompanied by a clear explanation in the PR description or PR discussion/code comments justifying why the break is necessary. This is important because LLMs generating code against newer client versions rely heavily on training data from older versions; undocumented breaking changes degrade their effectiveness and produce broken code for users. When such a change lacks justification, request that the author either add a clear rationale (and, where possible, a migration note) or restore backwards compatibility (e.g., via a deprecation path).
6 changes: 3 additions & 3 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: 'bump-version'
name: "bump-version"

on:
workflow_dispatch:
inputs:
bump_type:
description: 'Version bump type'
description: "Version bump type"
required: true
type: choice
options:
Expand All @@ -25,7 +25,7 @@ jobs:
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
ref: main

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/clean-up.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: 'misc'
name: "misc"

permissions: {}
on:
workflow_dispatch:
push:
schedule:
- cron: '0 10 * * *'
- cron: "0 10 * * *"

concurrency:
group: '${{ github.workflow }}-${{ github.ref }}'
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
Expand All @@ -19,7 +19,7 @@ jobs:
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3

- name: Setup NodeJS
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Copilot Setup Steps'
name: "Copilot Setup Steps"
permissions: {}

# Automatically run the setup steps when they are changed to allow for easy validation,
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/e2e-skills.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Skills E2E'
name: "Skills E2E"

permissions: {}
on:
Expand All @@ -16,7 +16,7 @@ jobs:
skills-packaging:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3

- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'examples'
name: "examples"

permissions: {}
on:
Expand All @@ -8,26 +8,26 @@ on:
- main
- release
paths-ignore:
- '**/*.md'
- 'LICENSE'
- 'benchmarks/**'
- "**/*.md"
- "LICENSE"
- "benchmarks/**"
pull_request:
paths-ignore:
- '**/*.md'
- 'LICENSE'
- 'benchmarks/**'
- "**/*.md"
- "LICENSE"
- "benchmarks/**"

concurrency:
group: '${{ github.workflow }}-${{ github.ref }}'
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

env:
OTEL_SERVICE_NAME: vitest
OTEL_EXPORTER_OTLP_ENDPOINT: ${{ secrets.OTEL_EXPORTER_OTLP_ENDPOINT }}
OTEL_EXPORTER_OTLP_HEADERS: 'authorization=${{ secrets.OTEL_EXPORTER_OTLP_API_KEY }}'
OTEL_RESOURCE_ATTRIBUTES: 'service.namespace=clickhouse-js,deployment.environment=ci'
VITEST_OTEL_ENABLED: 'true'
VITEST_COVERAGE: 'true'
OTEL_EXPORTER_OTLP_HEADERS: "authorization=${{ secrets.OTEL_EXPORTER_OTLP_API_KEY }}"
OTEL_RESOURCE_ATTRIBUTES: "service.namespace=clickhouse-js,deployment.environment=ci"
VITEST_OTEL_ENABLED: "true"
VITEST_COVERAGE: "true"

jobs:
code-quality:
Expand All @@ -41,7 +41,7 @@ jobs:
run:
working-directory: examples/${{ matrix.package }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3

- name: Setup NodeJS
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
Expand Down Expand Up @@ -72,15 +72,15 @@ jobs:
run:
working-directory: examples/${{ matrix.package }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3

- name: Start ClickHouse (version - ${{ matrix.clickhouse }}) in Docker
uses: isbang/compose-action@3846bcd61da338e9eaaf83e7ed0234a12b099b72 # v2.4.2
env:
CLICKHOUSE_VERSION: ${{ matrix.clickhouse }}
with:
compose-file: 'docker-compose.yml'
down-flags: '--volumes'
compose-file: "docker-compose.yml"
down-flags: "--volumes"

- name: Setup NodeJS
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
npm run run-examples

success:
needs: ['code-quality', 'run-examples']
needs: ["code-quality", "run-examples"]
runs-on: ubuntu-latest
steps:
- name: All examples checks passed
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/github-export-otel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
env:
OTEL_SERVICE_NAME: github-actions
OTEL_EXPORTER_OTLP_ENDPOINT: ${{ secrets.OTEL_EXPORTER_OTLP_ENDPOINT }}
OTEL_EXPORTER_OTLP_HEADERS: 'authorization=${{ secrets.OTEL_EXPORTER_OTLP_API_KEY }}'
OTEL_RESOURCE_ATTRIBUTES: 'service.namespace=clickhouse-js'
OTEL_EXPORTER_OTLP_HEADERS: "authorization=${{ secrets.OTEL_EXPORTER_OTLP_API_KEY }}"
OTEL_RESOURCE_ATTRIBUTES: "service.namespace=clickhouse-js"
with:
# Required for collecting workflow data
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading