clickhouse-hello-world

Featured

Create your first ClickHouse table, insert data, and run analytical queries. Use when starting a new ClickHouse project, learning MergeTree basics, or testing your ClickHouse connection with real operations. Trigger: "clickhouse hello world", "first clickhouse table", "clickhouse quick start", "create clickhouse table", "clickhouse example".

AI & Automation 2,359 stars 334 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# ClickHouse Hello World ## Overview Create a MergeTree table, insert rows with JSONEachRow, and run your first analytical query -- all using the official `@clickhouse/client`. ## Prerequisites - `@clickhouse/client` installed and connected (see `clickhouse-install-auth`) ## Instructions ### Step 1: Create a MergeTree Table ```typescript import { createClient } from '@clickhouse/client'; const client = createClient({ url: process.env.CLICKHOUSE_HOST ?? 'http://localhost:8123', username: process.env.CLICKHOUSE_USER ?? 'default', password: process.env.CLICKHOUSE_PASSWORD ?? '', }); await client.command({ query: ` CREATE TABLE IF NOT EXISTS events ( event_id UUID DEFAULT generateUUIDv4(), event_type LowCardinality(String), user_id UInt64, payload String, created_at DateTime DEFAULT now() ) ENGINE = MergeTree() ORDER BY (event_type, created_at) PARTITION BY toYYYYMM(created_at) TTL created_at + INTERVAL 90 DAY `, }); console.log('Table "events" created.'); ``` **Key concepts:** - `MergeTree()` -- the foundational ClickHouse engine for analytics - `ORDER BY` -- defines the primary index (sort key); pick columns you filter/group on - `PARTITION BY` -- splits data into parts by month for efficient pruning - `TTL` -- automatic data expiration - `LowCardinality(String)` -- dictionary-encoded string, ideal for columns with < 10K distinct values ### Step 2: Insert Data with JSONEachRow ```typescript...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
8 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category