/clickhouse-pack:clickhouse-deploy-integrationfrom clickhouse-pack
Deploys ClickHouse-backed applications to Vercel, Fly.io, and Cloud Run with connection pooling, secrets, and health checks. Use when deploying apps that connect to ClickHouse Cloud or configuring deployment pipelines.
Ships in clickhouse-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Deploy applications that connect to ClickHouse Cloud from serverless and container platforms with proper connection management and secrets handling. The same platform-agnostic connection module drives all three targets — Vercel, Fly.io, and Cloud Run — so only the secrets mechanism and runtime model change per platform.
Write a singleton client so a serverless cold start reuses one connection
instead of opening a new pool per invocation. Keep max_open_connections low
for serverless and enable compression to cut egress.
// src/db.ts — singleton for serverless-safe connections
import { createClient, ClickHouseClient } from '@clickhouse/client';
let client: ClickHouseClient | null = null;
export function getClickHouse(): ClickHouseClient {
if (!client) {
client = createClient({
url: process.env.CLICKHOUSE_HOST!, // https://<host>:8443
username: process.env.CLICKHOUSE_USER!,
password: process.env.CLICKHOUSE_PASSWORD!,
database: process.env.CLICKHOUSE_DATABASE ?? 'default',
request_timeout: 30_000,
max_open_connections: 5, // Low for serverless (many cold starts)
compression: {
request: true, // Saves egress bandwidth
response: true,
},
});
}
return client;
}
Choose the target that matches your runtime model, then set secrets and deploy.
All three import the getClickHouse() module above unchanged.
vercel env add per secret; best for API
endpoints. Keep max_open_connections at 1-3.fly secrets set + a fly.toml health check; best
for long-running apps with persistent connections.--set-secrets);
best for event-driven workloads. Set --min-instances=1 to avoid cold-start
connection churn.Full per-platform commands, the Next.js App Router query example, fly.toml,
the Cloud Run deploy script, and a platform comparison table:
Platform deployment walkthrough.
Expose a /health endpoint that pings ClickHouse (drives Fly.io / Cloud Run
readiness probes) and close the client on SIGTERM/SIGINT so pending inserts
flush before the container is recycled. Full code:
Production patterns.
Running this skill produces a deployable ClickHouse-connected application:
src/db.ts — a singleton ClickHouse client, serverless-safe and compressed.fly.toml + fly secrets,
or a Cloud Run service wired to Secret Manager./health endpoint reporting { status, clickhouse: { connected, latencyMs } }.SIGTERM/SIGINT.| Issue | Cause | Solution |
|---|---|---|
ECONNRESET on Vercel | Function timeout | Reduce query scope, increase timeout |
TLS handshake failed | Wrong port | Use port 8443 for Cloud |
| Secret not found | Env var not set | Check platform secret config |
| Cold start latency | New connection per invocation | Use min-instances=1 on Cloud Run |
Deploy an analytics API to Vercel: set the four CLICKHOUSE_* secrets with
vercel env add, drop the getClickHouse() module in src/db.ts, and add a
route that runs a parameterized SELECT ... GROUP BY event_type. See the full
Next.js App Router handler under the Vercel section of the
Platform deployment walkthrough.
Deploy a long-running container to Fly.io: add a [[http_service.checks]]
block pointing at /health, fly secrets set the ClickHouse credentials, then
fly deploy — see the complete fly.toml in the
Platform deployment walkthrough.
Deploy an event-driven service to Cloud Run: store host + password in Secret
Manager, wire them with --set-secrets, and set --min-instances=1. Full
deploy script in the
Platform deployment walkthrough.
For data ingestion patterns, see clickhouse-webhooks-events.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
24 skills in this plugin
/clickhouse-ci-integrationRun ClickHouse integration tests in CI with GitHub Actions and Docker
containers. Use when setting up automated testing against a real ClickHouse
instance, configuring CI pipelines, or implementing schema validation in CI.
Trigger with "clickhouse CI", "clickhouse GitHub Actions", "clickhouse
integration tests", "test clickhouse in CI", "clickhouse automated testing".
/clickhouse-common-errorsDiagnose and fix the top 15 ClickHouse errors — query failures, insert problems,
memory limits, and merge issues.
Use when a ClickHouse query or insert throws an exception, a server-side error
appears in logs, or a failed query needs root-cause analysis.
Trigger with "clickhouse error", "fix clickhouse", "clickhouse not working",
"debug clickhouse", "clickhouse exception", "clickhouse syntax error".
/clickhouse-core-workflow-aDesign ClickHouse schemas with MergeTree engines, ORDER BY keys, and
partitioning.
Use when creating new tables, choosing an engine, designing sort keys, or
modeling data for analytical workloads on ClickHouse or ClickHouse Cloud.
Trigger with "clickhouse schema design", "clickhouse table design",
"clickhouse ORDER BY", "clickhouse partitioning", "MergeTree table".
/clickhouse-core-workflow-bInsert, query, and aggregate data in ClickHouse with real SQL patterns.
Use when writing analytical queries, inserting data at scale, building
dashboards, or implementing materialized views for pre-aggregation.
Trigger with "clickhouse query", "clickhouse insert", "clickhouse aggregate",
"clickhouse materialized view", "clickhouse SQL".
/clickhouse-cost-tuningOptimize ClickHouse Cloud costs — compute scaling, storage tiering, compression,
and query efficiency for lower bills.
Use when analyzing ClickHouse Cloud bills, reducing storage costs, or optimizing
compute utilization.
Trigger with "clickhouse cost", "clickhouse billing", "reduce clickhouse spend",
"clickhouse pricing", "clickhouse expensive", "clickhouse storage cost".
/clickhouse-data-handlingHandle data lifecycle in ClickHouse — TTL expiration, data deletion (GDPR),
column-level encryption, and audit logging with real ClickHouse SQL.
Use when implementing data retention, fulfilling GDPR/CCPA deletion requests,
or managing sensitive data in ClickHouse.
Trigger with "clickhouse data retention", "clickhouse TTL", "clickhouse GDPR",
"delete data clickhouse", "clickhouse data lifecycle", "clickhouse PII".
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin clickhouse-packOther plugins' skills for the same job