Genera código TypeScript/JavaScript que lee/decodifica Y escribe/codifica streams RowBinary de ClickHouse para el servidor HTTP de ClickHouse. Usa esta skill siempre que el usuario quiera analizar o producir `RowBinary`, `RowBinaryWithNames` o `RowBinaryWithNamesAndTypes`. Solo Node.js; no cubre navegadores.
Compatibilidad
Con tu gateway de Versatile, cualquier cliente MCP carga las instrucciones de esta skill. Que además pueda hacer el trabajo depende de lo que la skill necesita y de lo que el cliente ejecuta.
Requiere
Nada más que leer sus instrucciones
| Cliente | Funciona | Por qué | Lee SKILL.md de forma nativa |
|---|---|---|---|
| Claude Code | Completo | Tiene todo lo que esta skill necesita | Sí |
| Codex CLI | Completo | Tiene todo lo que esta skill necesita | Sí |
| Cursor | Completo | Tiene todo lo que esta skill necesita | Sí |
| Gemini CLI | Completo | Tiene todo lo que esta skill necesita | Sí |
| VS Code Copilot | Completo | Tiene todo lo que esta skill necesita | Sí |
| opencode / oh-my-pi | Completo | Tiene todo lo que esta skill necesita | Sí |
| Claude Desktop | Completo | Tiene todo lo que esta skill necesita | Sí |
| ChatGPT and other chat-only MCP clients | Completo | Tiene todo lo que esta skill necesita | No |
Cómo lo determinamos
Nada de esto se ejecutó ni se probó. Cada veredicto se deriva de los archivos de la propia skill y de una tabla fija de reglas, así que léelo como una previsión, no como una garantía.
De la skill leemos las herramientas que permite el frontmatter, los lenguajes de sus scripts, los comandos que cita en el código, el uso de red y los servidores MCP que espera.
De cada cliente usamos tres cosas que hace en tu máquina sin servidores extra: ejecutar comandos, leer y escribir archivos y acceder a la web. La búsqueda integrada de una app de chat no cuenta, porque una skill no puede accionarla.
Completo significa que el cliente hace todo lo que la skill necesita. Solo las instrucciones significa que carga y sigue el texto, pero le falta una capacidad que la skill usa. No significa que la skill trae código y el cliente no puede ejecutarlo.
--- 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)
193 archivos, 678,8 KB
- .gitignore106 B
- AGENTS.md2,9 KB
- CHANGELOG.md3 KB
- EXAMPLES.md5,5 KB
- README.md15,3 KB
- SKILL.md5 KB
- case-studies/iot-rowbinary-vs-json.md4 KB
- case-studies/ledger-rowbinary-vs-json.md5,3 KB
- case-studies/logs-json-wins.md4,4 KB
- case-studies/wasm-vs-js.md9,9 KB
- eval_result.md6,2 KB
- eval_result_composer.md7,6 KB
- eval_result_haiku.md8,9 KB
- eval_result_sonnet.md6,1 KB
- package-lock.json40,1 KB
- package.json1,9 KB
- reader.md14,6 KB
- src/examples/carts.ts2,7 KB
- src/examples/events.ts2,1 KB
- src/examples/iot.ts6,3 KB
- src/examples/ledger.ts3,6 KB
- src/examples/logs.ts3 KB
- src/examples/observability.ts5,4 KB
- src/examples/orders.ts2,9 KB
- src/examples/profiles.ts2,2 KB
- src/examples/telemetry.ts3,5 KB
- src/readers/aggregateFunction.ts1,7 KB
- src/readers/bool.ts282 B
- src/readers/columnar.ts6 KB
- src/readers/compile.ts11,1 KB
- src/readers/composite.ts7,1 KB
- src/readers/core.ts3 KB
- src/readers/datetime.ts4,2 KB
- src/readers/decimals.ts2,5 KB
- src/readers/dynamic.ts12,3 KB
- src/readers/enums.ts1,6 KB
- src/readers/floats.ts1,3 KB
- src/readers/geo.ts3,5 KB
- src/readers/header.ts1 KB
- src/readers/integers.ts3,4 KB
- src/readers/interval.ts1,6 KB
- src/readers/ip.ts3,1 KB
- src/readers/json.ts1,4 KB
- src/readers/lowCardinality.ts750 B
- src/readers/nested.ts1 KB
- src/readers/nothing.ts1,3 KB
- src/readers/reader.ts3,1 KB
- src/readers/rowBinaryWithNamesAndTypes.ts6,9 KB
- src/readers/rows.ts2,3 KB
- src/readers/simpleAggregateFunction.ts797 B
- src/readers/stream.ts12 KB
- src/readers/strings.ts2 KB
- src/readers/time.ts2,2 KB
- src/readers/uuid.ts5,6 KB
- src/readers/varint.ts2,9 KB
- src/writers/aggregateFunction.ts796 B
- src/writers/bool.ts285 B
- src/writers/composite.ts5 KB
- src/writers/core.ts3,9 KB
- src/writers/datetime.ts4,5 KB
- src/writers/decimals.ts2,1 KB
- src/writers/enums.ts580 B
- src/writers/floats.ts1,8 KB
- src/writers/geo.ts4,5 KB
- src/writers/integers.ts3,7 KB
- src/writers/interval.ts463 B
- src/writers/ip.ts4,2 KB
- src/writers/lowCardinality.ts454 B
- src/writers/nested.ts776 B
- src/writers/nothing.ts941 B
- src/writers/rows.ts6,7 KB
- src/writers/simpleAggregateFunction.ts434 B
- src/writers/strings.ts3 KB
- src/writers/time.ts2,1 KB
- src/writers/uuid.ts2,2 KB
- src/writers/varint.ts2,4 KB
- src/writers/writer.ts3,1 KB
- tests/AggregateFunction.write.test.ts411 B
- tests/Array.test.ts2,3 KB
- tests/BFloat16.test.ts1,4 KB
- tests/Bool.test.ts1,1 KB
- tests/BoolEnumFloat.write.test.ts4,3 KB
- tests/Composite.write.test.ts3,2 KB
- tests/Date.test.ts1,3 KB
- tests/Date32.test.ts1,4 KB
- tests/DateTime.test.ts1,4 KB
- tests/DateTime.write.test.ts3,5 KB
- tests/DateTime64.test.ts1,9 KB
- tests/DateTime64P3.test.ts1,4 KB
- tests/DateTime64P6.test.ts1,4 KB
- tests/DateTime64P9.test.ts1,3 KB
- tests/Decimal.write.test.ts2,9 KB
- tests/Decimal128.test.ts1,6 KB
- tests/Decimal256.test.ts1,6 KB
- tests/Decimal32.test.ts1,9 KB
- tests/Decimal64.test.ts1,5 KB
- tests/Dynamic.test.ts12,6 KB
- tests/Enum16.test.ts1,9 KB
- tests/Enum8.test.ts1,8 KB
- tests/FixedString.test.ts1,4 KB
93 archivos más en el origen.
- Licencia
- Apache-2.0encontrada en repository
- Listado
- Descargar el YAML
Gateway en el puerto 7465 cambiar
Se guarda solo en este navegador.
¿Aún no tienes el gateway? Pega esto en tu terminal y vuelve a hacer clic en Importar.
git clone https://github.com/versatile-sh/connector-engine && cd connector-engine && make upImportar abre tu propio gateway en una pestaña nueva; esta página nunca se conecta con él. Cómo funciona