Loading...
Loading...
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, managing sessions and temporary tables, working with data types or customizing JSON parsing. Do NOT use for browser/Web client code.
npx skill4agent add clickhouse/agent-skills clickhouse-js-node-coding⚠️ Node.js runtime only. This skill covers thepackage running in a Node.js runtime exclusively — including Next.js Node runtime API routes, React Server Components, Server Actions, and standard Node.js processes. Do not apply this skill to browser client components, Web Workers, Next.js Edge runtime, Cloudflare Workers, or any usage of@clickhouse/client. For browser/edge environments, the correct package is@clickhouse/client-web.@clickhouse/client-web
@clickhouse/client@clickhouse/client-webcreateClient({ url })await client.close()JSONEachRowexamples/node/performance/clickhouse_settingscreateClientclickhouse_settingsinsert()query()command()query_paramsreference/query-parameters.mdclient.insert()client.query()resultSet.json().text().stream()client.command()CREATEDROPTRUNCATEALTERSETclient.exec()client.ping(){ success, error? }pathname>= 1.0.0BigIntquery_params>= 1.15.0TupleParamMapquery_params>= 1.9.0json.parsejson.stringify>= 1.14.0TimeTime64>= 25.6DynamicVariantJSON>= 24.124.524.825.3| Task | Triggers / symptoms | Reference file |
|---|---|---|
| Configure / connect the client | Building a | |
| Ping the server | Health checks, readiness probes, "is ClickHouse up?" | |
| Choose an insert format | "Which format should I use to insert?", JSON vs raw, | |
| Insert into a subset of columns / different database | | |
| Insert values, expressions, dates, decimals | | |
| Async inserts (server-side batching) | | |
| Select and parse results | | |
| Parameterize queries | Binding values, special characters / escaping, "SQL injection?", | |
| Sessions & temporary tables | | |
| Modern data types | | |
| Custom JSON parse/stringify | Plug in | |
import { createClient } from '@clickhouse/client'await client.close()format: 'JSONEachRow'values: [...]await (await client.query({...})).json<RowType>(){name: Type}$1?:nameclickhouse_settings: { wait_end_of_query: 1 }command()@clickhouse/clientECONNRESETclickhouse-js-node-troubleshootingexamples/node/performance/examples/node/security/CREATE TABLEexamples/node/schema-and-deployments/@clickhouse/client-webexamples/web/examples/node/coding/