clickhouse-js-node-rowbinary
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.
- 01GitHub stars
- 564
- 02Installs
- New
- 03Files scanned
- 30
Security scan
Needs reviewSuspicious-but-common patterns. Skim the findings before installing.
Not scanned (too large or unreadable): skills/clickhouse-js-node-rowbinary/src/readers/core.ts, skills/clickhouse-js-node-rowbinary/src/readers/datetime.ts, skills/clickhouse-js-node-rowbinary/src/readers/decimals.ts, skills/clickhouse-js-node-rowbinary/src/readers/dynamic.ts, skills/clickhouse-js-node-rowbinary/src/readers/enums.ts
Content sha256 310bad47ed25ffb3… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.md
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
RowBinarypayload to send to ClickHouse → writer.md. TheSink/writeXbuilding blocks,writeRowsstreaming, 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
DataViewread.
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
DataViewaccessors passing a literaltruefor thelittleEndianflag. -
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/writeXfunctions 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/yieldboundary 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?
Files
30- AGENTS.md
662be1d8542.9 KB - CHANGELOG.md
72392e889f3.0 KB - EXAMPLES.md
5cfabaa8395.5 KB - README.md
ef34d743cd15.3 KB - SKILL.md
b31dff97a65.0 KB - case-studies/iot-rowbinary-vs-json.md
11df12b1f54.0 KB - case-studies/ledger-rowbinary-vs-json.md
0ccbda1cce5.3 KB - case-studies/logs-json-wins.md
8a8f0edaf64.4 KB - case-studies/wasm-vs-js.md
c738592f3c9.9 KB - eval_result.md
a21c8333c76.2 KB - eval_result_composer.md
e53a3fc7a07.6 KB - eval_result_haiku.md
733a8f10c18.9 KB - eval_result_sonnet.md
5aaf4287ee6.1 KB - package-lock.json
f65092ba7840.1 KB - package.json
97559b90af1.9 KB - reader.md
b65d90208514.6 KB - src/examples/carts.ts
0b5e3be1012.7 KB - src/examples/events.ts
254e571aa82.1 KB - src/examples/iot.ts
aac20f99466.3 KB - src/examples/ledger.ts
b5b706f8673.6 KB - src/examples/logs.ts
89e9292a443.0 KB - src/examples/observability.ts
8b0758247d5.4 KB - src/examples/orders.ts
65687e95c52.9 KB - src/examples/profiles.ts
23186113182.2 KB - src/examples/telemetry.ts
57a1af39cd3.5 KB - src/readers/aggregateFunction.ts
6e667132f61.7 KB - src/readers/bool.ts
2f0e4882c1282 B - src/readers/columnar.ts
c317413d176.0 KB - src/readers/compile.ts
ed241a49b011.1 KB - src/readers/composite.ts
9be45537537.1 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from ClickHouse/agent-skills8
Use 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 reading from S3, MySQL, PostgreSQL, MongoDB, ClickHouse Cloud,
Use when the user wants to run SQL — especially analytical SQL — on local files (parquet/csv/json), URLs, S3 paths, or remote databases (Postgres, MySQL, MongoDB, ClickHouse Cloud, Iceberg, Delta Lake) without setting up a server. Provides chDB — embedded ClickHouse SQL in Python with 1000+ function
MUST 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 explicit provenance labels.
MUST 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.
Write 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, selecting and parsing results, binding query parameters, manag
Troubleshoot 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 — including socket hang-up errors, Keep-Alive problems, stream hand
MUST 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 Patterns API, and recommends (does not apply) a fix.
Use when a user wants to wire an OpenTelemetry collector into a Managed ClickStack service on ClickHouse Cloud, either by deploying a new local collector (Docker run or Docker Compose) or by configuring their own existing collector, then send rich synthetic telemetry and verify it is visible in Clic
Related backend skillsscan passed
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Report browser/API/CLI/job/worker/webhook bugs. Use for: qa report only, just report bugs, test but dont fix. (gstack)
Select an NVSHMEM remote transport from target system and kernel evidence. Use for inter-node selection, compatibility checks, or configuration.
Use this when generating RTK Query endpoints from OpenAPI schemas with @rtk-query/codegen-openapi. Covers the empty API pattern, filterEndpoints, endpointOverrides, generated tags, and reviewing generated output before it becomes part of the app.
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context Protocol", "connect external service", mentions "${CLAUDE_PLUGIN_ROOT} with MCP", or discusses MCP server types (SSE, stdio, HTTP, WebSocket). Provides
Helps migrate self-managed Apache Kafka workloads to Amazon MSK Express. Inventories the source cluster (from IaC files, Kafka CLI output, or manual input), assesses MSK Express compatibility across topology, Kafka version, configs, auth, and quotas, produces a target Express specification (instance