Skills Agentes

Clickhouse Js Node Rowbinary

Genera código TypeScript/JavaScript que lee/decodifica y escribe/codifica streams RowBinary de ClickHouse para el servidor HTTP; solo para Node.js, no cubre navegadores.

Oficial
Estrellas
536

en todo el repo

Actividad
59

0–100, la ruta de este skill

Actualizado
hace 2 meses

último commit aquí

Commits
2

últimos 90 días

Contexto
1.3k tok

74 tok en reposo

Paquete
193 archivos

681 KB

Instalar

Funciona con cualquier agente que lea SKILL.md

npx -y skills add ClickHouse/agent-skills --skill clickhouse-js-node-rowbinary --agent claude-code

Se instala solo en este repositorio.

Qué hace

  • Genera código TypeScript/JavaScript que decodifica (lector) y codifica (escritor) streams RowBinary de ClickHouse
  • Deriva a reader.md o writer.md según si el usuario necesita decodificar o codificar
  • Aplica principios comunes: little-endian con DataView, monomorfización, inlining de operaciones leaf
  • Ayuda a decidir si RowBinary es el formato correcto frente a JSON*/Native antes de generar el parser

Úsalo cuando

  • El usuario quiere parsear o producir RowBinary, RowBinaryWithNames o RowBinaryWithNamesAndTypes
  • Se necesita código Node.js para leer o escribir el formato binario de ClickHouse
  • Hay columnas numéricas anchas, blobs binarios de ancho fijo o columnas numéricas de alto volumen

No lo uses cuando

  • Parseo de JSON / CSV / TSV / Parquet (usar clickhouse-js-node-coding)
  • Errores de conexión, cuelgues o desajustes de tipo (usar clickhouse-js-node-troubleshooting)
  • Entornos Browser / Web Worker / Edge (usar @clickhouse/client-web)

Qué lo activa

Di cualquiera de estas frases y el agente debería cargar este skill.

  • “Escribe un decodificador de RowBinaryWithNamesAndTypes en TypeScript para Node.js”
  • “Necesito codificar estos valores JS a RowBinary para enviarlos a ClickHouse”
  • “¿Cómo leo una columna Int128 desde un stream RowBinary en Node?”

SKILL.md

En inglés

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?

Reproducido de ClickHouse/agent-skills bajo licencia Apache-2.0. Leer esta página en markdown.

Archivos

193 archivos en el paquete. Solo se lee SKILL.md al activarse — las referencias se cargan si el skill decide que las necesita.

Antes de instalar

Solo aplica a Node.js, no cubre navegadores; requiere elegir primero reader.md o writer.md según la dirección necesaria.

Detalles

Creador
ClickHouse
Categoría
Bases de datos
Licencia
Apache-2.0
Recursos incluidos
Incluye scripts o referencias
Código fuente
Ver SKILL.md

Etiquetas

Más de ClickHouse/agent-skills

Este repo incluye 11 skills. Si instalas uno, normalmente ya tienes los demás. Ver el pack agent-skills entero y su comando de instalación

Configura y gestiona ClickHouse con la CLI clickhousectl: servidor local para desarrollo y servicios ClickHouse Cloud gestionados para producción, incluyendo auth, esquemas y conexión.

Costo de contexto al activarse
661 tok
Tamaño del paquete
5 archivos
Última actualización
hace 2 meses
Oficialbases de datos

Configura y gestiona Postgres con clickhousectl: Postgres local con Docker para desarrollo, o servicios Postgres gestionados en ClickHouse Cloud (conexiones, TLS, réplicas, failover, restauración).

Costo de contexto al activarse
664 tok
Tamaño del paquete
5 archivos
Última actualización
hace 2 meses
Oficialbases de datos

Conecta un colector OpenTelemetry a un servicio Managed ClickStack en ClickHouse Cloud, desplegando uno nuevo o configurando el existente, y envía telemetría sintética para verificarlo en ClickStack.

Costo de contexto al activarse
9.9k tok
Tamaño del paquete
2 archivos
Última actualización
hace 2 meses
Oficialdevops infraestructura

Escribe código idiomático para el cliente Node.js de ClickHouse (@clickhouse/client): configuración, ping, inserts, selects, parámetros, sesiones y tipos de datos. No usar para código de cliente Web/navegador.

Costo de contexto al activarse
2.8k tok
Tamaño del paquete
13 archivos
Última actualización
hace 3 meses
Oficialbases de datos

Soluciona problemas comunes del cliente Node.js de ClickHouse (@clickhouse/client): socket hang-up, Keep-Alive, streams, tipos de datos, TLS/proxy y timeouts.

Costo de contexto al activarse
1.3k tok
Tamaño del paquete
10 archivos
Última actualización
hace 3 meses
Oficialbases de datos

Úsalo obligatoriamente para investigar problemas de rendimiento en una instancia Postgres gestionada por ClickHouse: analiza métricas de Prometheus y patrones de consultas lentas, y recomienda (sin aplicar) una solución.

Costo de contexto al activarse
1.2k tok
Tamaño del paquete
13 archivos
Última actualización
hace 4 meses
Oficialbases de datos

Skills relacionados

Ejecuta SQL analítico con chDB, ClickHouse embebido en Python, sobre archivos locales, URLs, S3 o bases remotas (Postgres, MySQL, MongoDB, Iceberg, Delta Lake) sin servidor.

Costo de contexto al activarse
1.2k tok
Tamaño del paquete
8 archivos
Última actualización
hace 4 meses
Oficialbases de datos

Úsalo obligatoriamente al diseñar arquitecturas ClickHouse, elegir patrones de ingesta o modelado, o traducir buenas prácticas en diseños específicos del workload.

Costo de contexto al activarse
791 tok
Tamaño del paquete
15 archivos
Última actualización
hace 4 meses
Oficialbases de datos

Úsalo obligatoriamente al revisar schemas, queries o configuraciones de ClickHouse: contiene 31 reglas que deben verificarse antes de dar recomendaciones.

Costo de contexto al activarse
2.6k tok
Tamaño del paquete
37 archivos
Última actualización
hace 4 meses
Oficialbases de datos