Skip to main content

Build

Clickhouse Js Node Rowbinary

ClickHouseOfficialCertifiedStateful

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.

  • New
  • v1.0.1
  • Reviewed Jul 21
  • No reviews yet

Capabilities

  • Core guidance (both directions)

    These principles apply whether you are generating a reader or a…

  • Worked examples

    Six end-to-end examples with real speedup are catalogued in…

  • Out of scope

Getting started

Full instructions

Install the skill, then ask your AI tool for the task in plain words. The full SKILL.md below shows what it covers.

Instructions: SKILL.mdv1.0.1

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. 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. 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 /
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.

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
  • ClickHouse data types
  • ClickHouse JS client docs

Explore more skills

Browse all

Stateful context

Security

Loading security scan...

Reviews (0)

More from ClickHouse

View source →
clickhouse-best-practicesMUST USE when reviewing ClickHouse schemas, queries, native full-text search, or configurations. Contains 36 rules that MUST be checked before providing recommendations. Always read relevant rule files and cite specific rules in responses.2 installsclickhouse-managed-postgres-rcaMUST USE when investigating performance issues on a ClickHouse-managed Postgres instance. Provides an evidence-based RCA workflow that scrapes the Prometheus endpoint for system signal, pulls per-digest evidence from the Slow Query…1 installschdb-datastoreUse when the user has tabular data (pandas DataFrame, parquet, csv, Arrow, json) and wants to filter, group, aggregate, join, or speed up slow pandas. Provides chDB DataStore — same pandas API, ClickHouse engine underneath. Also handles…1 installsclickhouse-architecture-advisorMUST USE when designing ClickHouse architectures, selecting between ingestion or modeling patterns, or translating best practices into workload-specific system designs. Complements clickhouse-best-practices with decision frameworks and…0 installsclickhouse-js-node-codingWrite idiomatic application code with the ClickHouse Node.js client (`@clickhouse/client`). Use this skill whenever a user is *building* against the Node.js client — configuring the client, pinging, inserting rows in JSON or raw formats,…0 installsclickhouse-js-node-troubleshootingTroubleshoot and resolve common issues with the ClickHouse Node.js client (@clickhouse/client). Use this skill whenever a user reports errors, unexpected behavior, or configuration questions involving the Node.js client specifically —…0 installs

Frequently asked questions about clickhouse-js-node-rowbinary

What does the clickhouse-js-node-rowbinary skill do?

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. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the clickhouse-js-node-rowbinary skill?

Run `npx @skills-hub-ai/cli install clickhouse-js-node-rowbinary` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/clickhouse-js-node-rowbinary/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does clickhouse-js-node-rowbinary work with?

clickhouse-js-node-rowbinary runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the clickhouse-js-node-rowbinary skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use clickhouse-js-node-rowbinary after installing it?

In Claude Code, type `/clickhouse-js-node-rowbinary` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the clickhouse-js-node-rowbinary skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.

Badge for your README

Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.

Install on Skills Hub badge preview
Markdown
[![Install on Skills Hub](https://skills-hub.ai/api/badges/skill/clickhouse-js-node-rowbinary)](https://skills-hub.ai/skills/clickhouse-js-node-rowbinary)
HTML
<a href="https://skills-hub.ai/skills/clickhouse-js-node-rowbinary"><img src="https://skills-hub.ai/api/badges/skill/clickhouse-js-node-rowbinary" alt="Install on Skills Hub"></a>

More options in the badge docs.