clickhouse-js-node-rowbinary
This skill generates TypeScript/JavaScript code to decode and encode ClickHouse RowBinary wire format streams in Node.js.
Identity proven by GitHub's verified organisation badge (ClickHouse)
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode
- License
- Apache-2.0 (permissive)
- Pin
- f3d5c8fpinned Oct 9, 2026
- Context cost
- about 1,200 tokenswhen the skill loads
- GitHub stars
- 332on clickhouse/clickhouse-js
- Scripts
- 173 scripts
What it does
“Generate TypeScript/JavaScript code that reads/decodes AND writes/encodes ClickHouse RowBinary streams for the ClickHouse HTTP server. Use this skill whenever a user wants to parse or produce `RowBinary`, `RowBinaryWithNames`, or `RowBinaryWithNamesAndTypes`. Node.js only, doesn't cover browsers.”
Generated summary from the skill's own text
This skill generates TypeScript/JavaScript code to decode and encode ClickHouse RowBinary wire format streams in Node.js. It handles RowBinary, RowBinaryWithNames, and RowBinaryWithNamesAndTypes variants, providing readers to parse bytes into values and writers to serialize values back into bytes.
When to use it
- Processing wide numeric types like Int256, Decimal256 from ClickHouse
- Handling binary fixed-width data like IPv4, IPv6, UUID, FixedString
- High-volume columnar numeric data where throughput matters most
- Needing bidirectional codec generation for RowBinary format
When not to
- Data is mostly strings or JSON-like values consumed wholesale
- Columnar analytics is the main goal, use Native format instead
- Browser or Web Worker environments, use client-web instead
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add clickhouse/clickhouse-js --skill clickhouse-js-node-rowbinaryInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install clickhouse/clickhouse-js clickhouse-js-node-rowbinary@f3d5c8f36790af1c7e2a89b1e29725bc4c39e7faInstalls the commit we checked (f3d5c8f).
Copy by hand
Download the folder at f3d5c8f and put it in .claude/skills/clickhouse-js-node-rowbinary for Claude Code and in .agents/skills/clickhouse-js-node-rowbinary for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Claude Code plugin
/plugin install clickhouse@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Claude Code plugin
/plugin install clickhouse-best-practices@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "clickhouse-js-node-rowbinary" by ClickHouse. Source, pinned to commit f3d5c8f36790af1c7e2a89b1e29725bc4c39e7fa: https://github.com/clickhouse/clickhouse-js/tree/f3d5c8f36790af1c7e2a89b1e29725bc4c39e7fa/skills/clickhouse-js-node-rowbinary 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/clickhouse-js-node-rowbinary/ for Claude Code and .agents/skills/clickhouse-js-node-rowbinary/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/clickhouse/clickhouse-js-node-rowbinary-clickhouse-js
SKILL.md at the pin
--- name: clickhouse-js-node-rowbinary description: > Generate TypeScript/JavaScript code that reads/decodes AND writes/encodes ClickHouse RowBinary streams for the ClickHouse HTTP server. Use this skill whenever a user wants to parse or produce `RowBinary`, `RowBinaryWithNames`, or `RowBinaryWithNamesAndTypes`. Node.js only, doesn't cover browsers. --- # ClickHouse JS RowBinary Codec Generator for Node.js This skill generates both directions of the wire format: **readers** (decode bytes → values) and **writers** (encode values → bytes, the mirror). A given task normally needs only one side. This file is the shared entry point — the format gate plus the principles common to both directions; the per-direction decisions, guidance, and the per-type reference tables live in two sibling files. **Pick your side — read only the one you need:** - **Decoding a `RowBinary*` response** from ClickHouse into JS values → **[reader.md](reader.md)**. Streaming vs whole-buffer, row-objects vs columnar, fixed vs runtime schema, and the per-type reader reference. - **Encoding JS values into a `RowBinary` payload** to send to ClickHouse → **[writer.md](writer.md)**. The `Sink`/`writeX` building blocks, `writeRows` streaming, and the per-type writer reference. The per-type code is real, split by direction under `src/readers/` and `src/writers/`. ## First: is RowBinary even the right format? RowBinary exists for throughput, but it is **not automatically the fastest path** — match the format to the shape of the data before committing to a bespoke parser. **Prefer a `JSON*` format (e.g. `JSONEachRow`) when** the result is mostly strings / JSON-like values that you consume wholesale — randomly accessing essentially every field, running string/regexp methods on them, treating values as text. V8's native `JSON.parse` is heavily optimized C++ and builds JS strings and objects faster than a JS-level RowBinary decoder can; pair it with HTTP response compression (`gzip` / `zstd`, which crushes JSON's repetitive keys) and the wire cost shrinks too. **RowBinary clearly wins when** the result is dominated by: - **Wide numerics** — `Int128`/`Int256`/`UInt128`/`UInt256`, `Decimal128`/`Decimal256`. - **Binary / fixed-width blobs** — `IPv4`, `IPv6`, `UUID`, `FixedString`. - **High-volume fixed-width numeric columns** generally, where each value is a single `DataView` read. **Prefer the `Native` format when** columnar load and client-side analytics are the main goal (fold/scan/filter columns, feed typed arrays to a Worker or WASM). `Native` is column-major, so it loads straight into one typed array per column with no transpose. For help choosing and consuming a `JSON*` format (or CSV / TSV) instead, use the **`clickhouse-js-node-coding`** skill. ## Core guidance (both directions) These principles apply whether you are generating a reader or a writer; the side-specific operational guidance is in [reader.md](reader.md) / [writer.md](writer.md). - **Little-endian only.** RowBinary is little-endian; target x86/ARM. Read and write every multi-byte number with `DataView` accessors passing a **literal** `true` for the `littleEndian` flag. - **Correct first, then optimize.** First emit a correct codec built from the plain per-type API. Only after it's correct (and tested) specialize it. Don't bake performance assumptions in before correctness. - **Monomorphize generic/composite types.** Emit specialized, inlined code per type combination instead of passing functions as arguments where the type is known ahead of time. - **Inline the leaf ops.** The per-type `readX`/`writeX` functions are the correct, composable reference; the generated codec should INLINE their bodies, not call them, so the row loop is straight-line with no per-field indirection (and so the fixed-width coalescing can fold the offset arithmetic together). - **Annotate the type per column.** Inlining erases the type structure, so put a short comment above each column's encode/decode block naming the ClickHouse type it handles. - **Shared scratch is not reentrant.** Some hot methods reuse a module-level scratch buffer as a write-then-read pair — correct only because the access is fully synchronous. An `async`/`yield` boundary between populating and reading it corrupts the value. - **TypeScript by default.** Generate TypeScript code and helpers unless the user explicitly asks for plain JavaScript. ## Worked examples Six end-to-end examples with real speedup are catalogued in [EXAMPLES.md](EXAMPLES.md). ## Out of scope - **JSON / CSV / TSV / Parquet parsing** → use `clickhouse-js-node-coding`. - **Connection errors, hangs, type mismatches** → use `clickhouse-js-node-troubleshooting`. - **Browser / Web Worker / Edge** → `@clickhouse/client-web`. ## Still Stuck? - [ClickHouse RowBinary format](https://clickhouse.com/docs/interfaces/formats#rowbinary) - [ClickHouse data types](https://clickhouse.com/docs/sql-reference/data-types) - [ClickHouse JS client docs](https://clickhouse.com/docs/integrations/javascript)
From clickhouse/clickhouse-js at f3d5c8f, shown as plain text under its license: Apache-2.0 (permissive). The license text is in LICENSE.
View SKILL.md on GitHub at f3d5c8fFiles
- SKILL.md5.1 KB · b31dff97a6c0
- .gitignore106 B · ac74543bf470
- AGENTS.md3.0 KB · 662be1d85496
- CHANGELOG.md3.1 KB · 72392e889ffd
- EXAMPLES.md5.6 KB · 5cfabaa839a7
- README.md16 KB · ef34d743cd3a
- case-studies/
- iot-rowbinary-vs-json.md4.1 KB · 11df12b1f575
- ledger-rowbinary-vs-json.md5.4 KB · 0ccbda1cceb4
- logs-json-wins.md4.5 KB · 8a8f0edaf627
- wasm-vs-js.md10 KB · c738592f3c37
- eval_result.md6.3 KB · a21c8333c727
- eval_result_composer.md7.8 KB · e53a3fc7a0e3
- eval_result_haiku.md9.1 KB · 733a8f10c1ff
- eval_result_sonnet.md6.3 KB · 5aaf4287eee4
- package-lock.json41 KB · f65092ba78a7
- package.json2.0 KB · 97559b90afdc
- reader.md15 KB · b65d902085a9
- src/
- examples/
- carts.ts2.8 KB · 0b5e3be101c6
- events.ts2.2 KB · 254e571aa8ee
- iot.ts6.5 KB · aac20f9946a5
- ledger.ts3.7 KB · b5b706f867cc
- logs.ts3.1 KB · 89e9292a444f
- observability.ts5.5 KB · 8b0758247d2f
- orders.ts3.0 KB · 65687e95c559
- profiles.ts2.3 KB · 23186113189d
- telemetry.ts3.5 KB · 57a1af39cda5
- readers/
- aggregateFunction.ts1.8 KB · 6e667132f662
- bool.ts282 B · 2f0e4882c1df
- columnar.ts6.2 KB · c317413d17b9
- compile.ts11 KB · ed241a49b02a
- composite.ts7.2 KB · 9be455375382
- core.ts3.1 KB · ef27e1b93df0
- datetime.ts4.3 KB · 7c3abeab96de
- decimals.ts2.5 KB · 48ea470162f9
- dynamic.ts13 KB · 737ba9890eec
- enums.ts1.7 KB · 81aaf073eac6
- floats.ts1.3 KB · 7e3b8ebab5d2
- geo.ts3.6 KB · 95908d5e2ae4
- header.ts1.1 KB · 44cbcf5ed8b7
- integers.ts3.5 KB · 3234c23ad90c
- interval.ts1.6 KB · 978413150bed
- ip.ts3.1 KB · 2270cfbfcd20
- json.ts1.5 KB · f82765a04fad
- lowCardinality.ts750 B · 53b13656ecae
- nested.ts1.1 KB · 5dfb2ce4d3fb
- nothing.ts1.4 KB · 731a6764c190
- reader.ts3.2 KB · eedd3d505af2
- rowBinaryWithNamesAndTypes.ts7.1 KB · b0d6c7f83040
- rows.ts2.3 KB · 21d4bc913c9d
- simpleAggregateFunction.ts797 B · cb08bf933f8a
- stream.ts12 KB · 70bbe06e4ba9
- strings.ts2.1 KB · 64b0e3d4b417
- time.ts2.3 KB · 1f7fab5fc87a
- uuid.ts5.7 KB · fe80de1935d2
- varint.ts3.0 KB · e9fb93eb63e6
- writers/
- aggregateFunction.ts796 B · 9c3d9d72107d
- bool.ts285 B · ccd9c07d37b1
- composite.ts5.1 KB · d9b104ba60dc
- core.ts4.0 KB · 0b1115a3af39
- datetime.ts4.7 KB · f1cb13f31016
- decimals.ts2.2 KB · 6e69e38737ae
- enums.ts580 B · 2d8c4208c976
- floats.ts1.8 KB · da9b031adf81
- geo.ts4.7 KB · 03c865bfdc98
- integers.ts3.8 KB · 95b60b564b7f
- interval.ts463 B · 09598f4dddd1
- ip.ts4.3 KB · 01c714d4515b
- lowCardinality.ts454 B · d3a0187ffb62
- nested.ts776 B · 4739e1c515f7
- nothing.ts941 B · 4c630f91e008
- rows.ts6.8 KB · 66669eaba6df
- simpleAggregateFunction.ts434 B · 870153183fcd
- strings.ts3.1 KB · d753d7390fd4
- time.ts2.1 KB · 8ae6cde13089
- uuid.ts2.2 KB · 6c564ec64936
- varint.ts2.4 KB · 2abc97a4685a
- writer.ts3.1 KB · d74fb9b7a8b1
- tests/
- AggregateFunction.write.test.ts411 B · 76226e438a29
- Array.test.ts2.3 KB · df42a7357a61
- BFloat16.test.ts1.4 KB · cc9743f8c976
- Bool.test.ts1.2 KB · bb54898e8436
- BoolEnumFloat.write.test.ts4.4 KB · d0126d843cbf
- Composite.write.test.ts3.3 KB · fcf67bd941f1
- Date.test.ts1.3 KB · c5bf69e5ba73
- Date32.test.ts1.4 KB · ff66d16cc91b
- DateTime.test.ts1.5 KB · e3b9ec907578
- DateTime.write.test.ts3.5 KB · f670e9110c73
- DateTime64.test.ts1.9 KB · 8f75d1b81522
- DateTime64P3.test.ts1.4 KB · f4745f713ca7
- DateTime64P6.test.ts1.4 KB · ce8178dda5e5
- DateTime64P9.test.ts1.4 KB · 5169a2e0238b
- Decimal.write.test.ts3.0 KB · 4549e3f81f9e
- Decimal128.test.ts1.7 KB · 050486166545
- Decimal256.test.ts1.7 KB · 08689b2dd68a
- Decimal32.test.ts2.0 KB · 1bb1214d1a72
- Decimal64.test.ts1.6 KB · ffd40878a94a
- Dynamic.test.ts13 KB · 0a0bb4202692
- Enum16.test.ts1.9 KB · 3847ae36c639
- Enum8.test.ts1.9 KB · 8e95556ead67
- FixedString.test.ts1.4 KB · 66dbebff9c82
- FixedStringBytes.test.ts1.5 KB · 7d131eb39095
- Float32.test.ts1.5 KB · 9bfcf95ee068
- Float64.test.ts1.5 KB · bec0216842be
- Geo.write.test.ts3.2 KB · 6f974796c9e5
- Geometry.test.ts2.0 KB · c4d05b1458d7
- IP.write.test.ts2.9 KB · cd8bc05db359
- IPv4.test.ts1.6 KB · 976d27d300db
- IPv6.test.ts2.2 KB · 36011066bfa3
- Int128.test.ts1.6 KB · d65b64e899c0
- Int16.test.ts2.4 KB · 61faff754806
- Int256.test.ts1.7 KB · 3c517f7c1dac
- Int32.test.ts1.4 KB · 8f1d6a30aecf
- Int64.test.ts1.5 KB · 19d2f0542023
- Int8.test.ts1.4 KB · c5ccf7d4beb7
- Integers.write.test.ts5.6 KB · 4fbaff7c73c8
- Interval.test.ts1.5 KB · 6cb2cf145fe7
- JSON.test.ts3.7 KB · 8d8070db38d3
- LineString.test.ts1.2 KB · 369801c5534e
- Map.test.ts2.2 KB · 1da8fce4a96a
- MultiLineString.test.ts1.3 KB · a1f62b39c9d8
- MultiPolygon.test.ts1.3 KB · eddc983b0fc7
- Nothing.write.test.ts810 B · 675a5e41397d
- Nullable.test.ts2.3 KB · a4054abc23a5
- Point.test.ts1.2 KB · 5bad9cf6ac33
- Polygon.test.ts1.2 KB · d2183a372fd8
- Ring.test.ts1.2 KB · 7bfc316cec91
- Rows.write.test.ts8.1 KB · 2ca81447e5b4
- String.test.ts1.8 KB · 6814a1880d12
- String.write.test.ts2.2 KB · b47ed7eb4200
- Time.test.ts1.6 KB · f96f3299bd6e
- Time64.test.ts1.6 KB · 435cdf24e717
- TimeInterval.write.test.ts2.3 KB · edbe0e2c1fad
- Tuple.test.ts1.8 KB · d8f38e81de5f
- TupleNamed.test.ts2.0 KB · f254876dae81
- UInt128.test.ts1.5 KB · df199306192e
- UInt16.test.ts1.4 KB · 8a47b43467cd
- UInt256.test.ts1.6 KB · 8e65387a7264
- UInt32.test.ts1.2 KB · b7dc58b4e11f
- UInt64.test.ts1.4 KB · 4b87dfca2eeb
- UInt8.test.ts1.3 KB · e078aebbc3e4
- UUID.test.ts4.0 KB · 25c2c921c2f1
- UUID.write.test.ts1.7 KB · d3b348cd0877
- UUIDBigInt.test.ts1.8 KB · 08a569c0c75b
- UUIDHiLo.test.ts2.1 KB · 1babb0d72452
- UVarint.test.ts3.6 KB · ff078f8b50ce
- UVarint.write.test.ts2.1 KB · becc269487d1
- Variant.test.ts2.6 KB · f1bac004db34
- advance.test.ts3.6 KB · c8027a312667
- aggregateFunction.test.ts4.1 KB · 6107532fea2d
- carts.bench.ts1.6 KB · 055f0374097f
- carts.example.test.ts1.9 KB · f1056a9d7437
- clickhouse.ts1.5 KB · c4c2bede1262
- coalesceChunks.test.ts5.3 KB · 38b911448b13
- columnar.test.ts5.6 KB · 0648837b5439
- combinations.generated.test.ts9.6 KB · 74c9143b3908
- compile.test.ts3.8 KB · 71cf79c849f9
- encode.ts842 B · 4fad9b0eddfd
- events.bench.ts1.6 KB · 98fab0e0e511
- events.example.test.ts1.9 KB · e235772cbc1f
- framing-interleaved.test.ts12 KB · 971fdd41e224
- framing-nested.test.ts12 KB · 5ebc240de578
- framing.test.ts19 KB · 7114540fc59d
- iot.bench.ts5.0 KB · 0cd3d59c60db
- iot.columnar.bench.ts1.9 KB · 1ac11dc90c09
- iot.wasm-headroom.bench.ts4.9 KB · ee5a398d8bfd
- ledger.bench.ts8.1 KB · ac316a10228a
- logs.bench.ts4.5 KB · 9edd936f1515
- lowCardinality.test.ts2.1 KB · cf27a2820324
- nested.test.ts2.2 KB · 3b6bc2433dba
- nothing.test.ts3.2 KB · 3b0599ecf95e
- observability.bench.ts2.5 KB · 0ef5187b582b
- observability.example.test.ts3.7 KB · 67aaf7269bea
- orders.bench.ts1.6 KB · 4ecabfdc2fdb
- orders.example.test.ts2.1 KB · 12b2ae344da1
- parseIP.bench.ts1.3 KB · 6d5d90e67e73
- profiles.bench.ts1.6 KB · 7ca243592432
- profiles.example.test.ts1.6 KB · 625662f764cc
- qbit.test.ts3.1 KB · a69049a2ccbb
- readHeader.test.ts864 B · c4d90d5391a0
- readUUID.bench.ts1.4 KB · 0cfa11a5ae23
- rowBinaryWithNamesAndTypes.order.test.ts2.8 KB · e3160e55c02c
- rowBinaryWithNamesAndTypes.test.ts19 KB · 689d86a97707
- rows.test.ts8.0 KB · 3615bb23d0ba
- simpleAggregateFunction.test.ts2.5 KB · 666d9b251a8b
- streamRowBatches.test.ts6.2 KB · 60a7ed413497
- streamingRow.bench.ts8.1 KB · fc24357259bd
- telemetry.bench.ts1.8 KB · cd20fe9f7c68
- telemetry.example.test.ts2.3 KB · e9f98d0d010d
- wasm-int128.experiment.mjs6.8 KB · e7c1b630c183
- tsconfig.build.json306 B · 60bbc7962a1a
- tsconfig.json476 B · dcba4a228614
- vitest.config.ts216 B · 4e7144bcb629
- writer.md7.4 KB · baad93272505
193 files, 695 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at f3d5c8fMore from ClickHouse
chdb-datastore
This skill enables working with tabular data using a pandas-compatible API backed by ClickHouse for faster execution.
Contains scripts
Claude Code, Codex, Cursor +3 · about 1.2K tokens · pinned 6 days ago
chdb-sql
The skill enables running ClickHouse SQL queries on local files (parquet, csv, json), remote databases (Postgres, MySQL, MongoDB, ClickHouse Cloud), and cloud…
Contains scripts
Claude Code, Codex, Cursor +3 · about 960 tokens · pinned 6 days ago
clickhouse-architecture-advisor
This skill guides agents through ClickHouse architecture decisions for specific workloads like observability, SIEM, and financial services.
Claude Code, Codex, Cursor +4 · about 690 tokens · pinned 6 days ago
clickhouse-best-practices
This skill provides 31 ClickHouse best practices rules covering schema design, query optimization, data ingestion, and agent connectivity.
Claude Code, Codex, Cursor +4 · about 2.5K tokens · pinned 6 days ago
clickhouse-js-node-rowbinary
This skill generates TypeScript/JavaScript code to read and write ClickHouse RowBinary format streams in Node.js.
Contains scripts
Claude Code, Codex, Cursor +3 · about 1.2K tokens · pinned 6 days ago
clickhouse-js-node-troubleshooting
Diagnose and fix issues with the ClickHouse Node.js client (@clickhouse/client) running in Node.js environments.
Claude Code, Codex, Cursor +4 · about 1.1K tokens · pinned 6 days ago
Related in Data and databases
clickhouse-js-node-coding
Write Node.js application code using the ClickHouse JavaScript client (@clickhouse/client).
by ClickHouseOfficial publisher
Claude Code, Codex, Cursor +4 · about 2.7K tokens · pinned 6 days ago
clickhouse-js-node-troubleshooting
Diagnoses and resolves issues with the ClickHouse Node.js client (@clickhouse/client) in Node.js environments.
by ClickHouseOfficial publisher
Claude Code, Codex, Cursor +4 · about 1.1K tokens · pinned 6 days ago
infra-clickhouse
Sets up and manages ClickHouse databases using clickhousectl CLI for local development or production deployment on ClickHouse Cloud.
by ClickHouseOfficial publisher
Contains scripts
Claude Code, Codex, Cursor +3 · about 510 tokens · pinned 6 days ago
infra-postgres
This skill sets up and manages Postgres databases using the clickhousectl CLI.
by ClickHouseOfficial publisher
Contains scripts
Claude Code, Codex, Cursor +3 · about 570 tokens · pinned 6 days ago
prisma-next-quickstart
This skill guides developers through setting up Prisma Next in three scenarios: starting a fresh project, adopting it into an existing codebase, or connecting…
by PrismaOfficial publisher
Claude Code, Codex, Cursor +4 · about 7.4K tokens · pinned 6 days ago
databricks-zerobus-ingest
This skill enables agents to build gRPC-based data ingestion clients that write records directly into Databricks Delta tables using the Zerobus Ingest SDK.
by DatabricksOfficial publisher
Claude Code, Codex, Cursor +4 · about 2.9K tokens · pinned 6 days ago