From clickhouse-pack
Installs official ClickHouse Node.js (@clickhouse/client) or Python (clickhouse-connect) clients and configures authentication for Cloud or self-hosted instances with connection verification examples.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin clickhouse-packThis skill is limited to using the following tools:
Set up the official ClickHouse client for Node.js or Python and configure authentication
Guides deployment of ClickHouse to ClickHouse Cloud using clickhousectl: account signup, CLI authentication (OAuth/API key), service creation, schema migration, app connection. For production or local-to-cloud migration.
Sets up local ClickHouse via Docker Compose with schema init scripts, Node.js data seeding, for dev iteration and vitest integration tests.
Manages ClickHouse Cloud users and permissions via SQL over HTTPS using curl and Bash. Useful for creating users, granting/revoking access, testing connectivity, and troubleshooting authentication.
Share bugs, ideas, or general feedback.
Set up the official ClickHouse client for Node.js or Python and configure authentication to ClickHouse Cloud or a self-hosted instance.
# Node.js — official client (HTTP-based, supports streaming)
npm install @clickhouse/client
# Python — official client
pip install clickhouse-connect
# .env (NEVER commit — add to .gitignore)
CLICKHOUSE_HOST=https://abc123.us-east-1.aws.clickhouse.cloud:8443
CLICKHOUSE_USER=default
CLICKHOUSE_PASSWORD=your-password-here
# Self-hosted (HTTP interface on port 8123, native on 9000)
# CLICKHOUSE_HOST=http://localhost:8123
import { createClient } from '@clickhouse/client';
// ClickHouse Cloud
const client = createClient({
url: process.env.CLICKHOUSE_HOST, // https://<host>:8443
username: process.env.CLICKHOUSE_USER, // default
password: process.env.CLICKHOUSE_PASSWORD,
// ClickHouse Cloud requires TLS — the client handles it via https:// URL
});
// Self-hosted (no TLS)
const localClient = createClient({
url: 'http://localhost:8123',
username: 'default',
password: '',
});
async function verifyConnection() {
// Ping returns true if the server is reachable
const alive = await client.ping();
console.log('ClickHouse ping:', alive.success); // true
// Run a test query
const rs = await client.query({
query: 'SELECT version() AS ver, uptime() AS uptime_sec',
format: 'JSONEachRow',
});
const rows = await rs.json<{ ver: string; uptime_sec: number }>();
console.log('Server version:', rows[0].ver);
console.log('Uptime (sec):', rows[0].uptime_sec);
}
verifyConnection().catch(console.error);
import clickhouse_connect
client = clickhouse_connect.get_client(
host='abc123.us-east-1.aws.clickhouse.cloud',
port=8443,
username='default',
password='your-password-here',
secure=True,
)
result = client.query('SELECT version(), uptime()')
print(f"Version: {result.result_rows[0][0]}")
| Option | Default | Description |
|---|---|---|
url | http://localhost:8123 | Full URL including protocol and port |
username | default | ClickHouse user |
password | '' | User password |
database | default | Default database for queries |
request_timeout | 30000 | Query timeout in ms |
compression.request | false | Compress request bodies (gzip) |
compression.response | true | Decompress responses |
max_open_connections | 10 | HTTP keep-alive pool size |
clickhouse_settings | {} | Server-side settings per session |
| Feature | Cloud | Self-Hosted |
|---|---|---|
| Port | 8443 (HTTPS) | 8123 (HTTP) / 8443 (HTTPS) |
| TLS | Required | Optional |
| Engine | SharedMergeTree | MergeTree family |
| Auth | User/password, Cloud API keys | User/password, LDAP, Kerberos |
| Error | Cause | Solution |
|---|---|---|
ECONNREFUSED | Server not running | Check host/port, verify ClickHouse is up |
Authentication failed | Wrong user/password | Verify credentials in ClickHouse users.xml or Cloud console |
CERTIFICATE_VERIFY_FAILED | TLS mismatch | Use https:// for Cloud, check CA certs for self-hosted |
TIMEOUT | Network/firewall | Check IP allowlists in Cloud console, firewall rules |
Database not found | Wrong database name | Run SHOW DATABASES to list available databases |
Proceed to clickhouse-hello-world for your first table and query.