Gera código TypeScript/JavaScript que lê/decodifica E escreve/codifica streams RowBinary do ClickHouse para o servidor HTTP do ClickHouse. Use esta skill sempre que o usuário quiser interpretar ou produzir `RowBinary`, `RowBinaryWithNames` ou `RowBinaryWithNamesAndTypes`. Somente Node.js; não cobre navegadores.
Compatibilidade
Pelo seu gateway Versatile, qualquer cliente MCP carrega as instruções desta skill. Se ele também consegue fazer o trabalho depende do que a skill precisa e do que o cliente executa.
Requer
Nada além de ler as instruções
| Cliente | Funciona | Por quê | Lê SKILL.md nativamente |
|---|---|---|---|
| Claude Code | Completo | Tem tudo o que esta skill precisa | Sim |
| Codex CLI | Completo | Tem tudo o que esta skill precisa | Sim |
| Cursor | Completo | Tem tudo o que esta skill precisa | Sim |
| Gemini CLI | Completo | Tem tudo o que esta skill precisa | Sim |
| VS Code Copilot | Completo | Tem tudo o que esta skill precisa | Sim |
| opencode / oh-my-pi | Completo | Tem tudo o que esta skill precisa | Sim |
| Claude Desktop | Completo | Tem tudo o que esta skill precisa | Sim |
| ChatGPT and other chat-only MCP clients | Completo | Tem tudo o que esta skill precisa | Não |
Como determinamos isso
Nada aqui foi executado ou testado. Cada veredito é derivado dos arquivos da própria skill e de uma tabela fixa de regras, então leia como uma previsão, não uma garantia.
Da skill lemos as ferramentas que o frontmatter permite, as linguagens dos scripts que ela traz, os comandos que cita no código, o uso de rede e os servidores MCP que espera.
De cada cliente usamos três coisas que ele faz na sua máquina sem servidores extras: executar comandos, ler e gravar arquivos e acessar a web. A busca embutida de um app de chat não conta, porque uma skill não consegue acioná-la.
Completo significa que o cliente faz tudo o que a skill precisa. Só as instruções significa que ele carrega e segue o texto, mas não tem uma capacidade que a skill usa. Não significa que a skill traz código e o cliente não consegue executá-lo.
--- 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 arquivos, 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
Mais 93 arquivos na origem.
- Licença
- Apache-2.0encontrada em repository
- Listagem
- Baixar o YAML
Gateway na porta 7465 alterar
Fica salvo só neste navegador.
Ainda não tem o gateway? Cole isto no seu terminal e clique em Importar de novo.
git clone https://github.com/versatile-sh/connector-engine && cd connector-engine && make upImportar abre o seu próprio gateway em uma nova aba; esta página nunca se conecta a ele. Como funciona