agentsclimarketplace

Clickhouse install auth

Skill ComeOnOliver/skillshub/skills/jeremylongshore/claude-code-plugins-plus-skills/clickhouse-install-auth

Install @clickhouse/client and configure authentication to ClickHouse Cloud or self-hosted. Use when setting up a new ClickHouse project, configuring connection strings, or initializing the official Node.js client. Trigger: "install clickhouse", "setup clickhouse client", "clickhouse auth", "connect to clickhouse", "clickhouse credentials".From its SKILL.md

Install
npx -y skills add ComeOnOliver/skillshub --skill clickhouse-install-auth

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

4.8 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it

ClickHouse Install & Auth

Overview

Set up the official ClickHouse client for Node.js or Python and configure authentication to ClickHouse Cloud or a self-hosted instance.

Prerequisites

  • Node.js 18+ or Python 3.8+
  • A running ClickHouse instance (Cloud or self-hosted)
  • Connection credentials (host, port, user, password)

Instructions

Step 1: Install the Official Client

# Node.js — official client (HTTP-based, supports streaming)
npm install @clickhouse/client

# Python — official client
pip install clickhouse-connect

Step 2: Configure Environment Variables

# .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

Step 3: Create the Client (Node.js)

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: '',
});

Step 4: Verify Connection

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);

Step 5: Python Alternative

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]}")

Connection Options Reference

OptionDefaultDescription
urlhttp://localhost:8123Full URL including protocol and port
usernamedefaultClickHouse user
password''User password
databasedefaultDefault database for queries
request_timeout30000Query timeout in ms
compression.requestfalseCompress request bodies (gzip)
compression.responsetrueDecompress responses
max_open_connections10HTTP keep-alive pool size
clickhouse_settings{}Server-side settings per session

ClickHouse Cloud vs Self-Hosted

FeatureCloudSelf-Hosted
Port8443 (HTTPS)8123 (HTTP) / 8443 (HTTPS)
TLSRequiredOptional
EngineSharedMergeTreeMergeTree family
AuthUser/password, Cloud API keysUser/password, LDAP, Kerberos

Error Handling

ErrorCauseSolution
ECONNREFUSEDServer not runningCheck host/port, verify ClickHouse is up
Authentication failedWrong user/passwordVerify credentials in ClickHouse users.xml or Cloud console
CERTIFICATE_VERIFY_FAILEDTLS mismatchUse https:// for Cloud, check CA certs for self-hosted
TIMEOUTNetwork/firewallCheck IP allowlists in Cloud console, firewall rules
Database not foundWrong database nameRun SHOW DATABASES to list available databases

Resources

Next Steps

Proceed to clickhouse-hello-world for your first table and query.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.