Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/clickhouse-core-workflow-a

@0d57af8
Run it yourself

Design 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".

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/clickhouse-core-workflow-a

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesimplementation.md

≈408 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Partitioning and Applying Schema

Detailed partitioning guidance plus the Node.js path for applying DDL programmatically with @clickhouse/client.

Partitioning Guidelines

Partition Expression Typical Use Parts Per Partition
toYYYYMM(date) Most common — monthly Target 10-1000
toMonday(date) Weekly rollups More parts, finer drops
toYYYYMMDD(date) Daily TTL drops Many parts — use carefully
None Small tables (<1M rows) Fine

Warning: Each partition creates separate parts on disk. Over-partitioning (e.g., by user_id) creates millions of tiny parts and kills performance.

Applying Schema via Node.js

Run DDL from application code so schema lives in version control alongside your service. command() is the right call for DDL (no result set is returned).

import { createClient } from '@clickhouse/client';

const client = createClient({ url: process.env.CLICKHOUSE_HOST! });

async function applySchema() {
  await client.command({ query: 'CREATE DATABASE IF NOT EXISTS analytics' });

  await client.command({
    query: `
      CREATE TABLE IF NOT EXISTS analytics.events (
        event_id   UUID DEFAULT generateUUIDv4(),
        tenant_id  UInt32,
        event_type LowCardinality(String),
        user_id    UInt64,
        payload    String CODEC(ZSTD(3)),
        created_at DateTime DEFAULT now()
      )
      ENGINE = MergeTree()
      ORDER BY (tenant_id, event_type, created_at)
      PARTITION BY toYYYYMM(created_at)
    `,
  });

  console.log('Schema applied.');
}

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill provides a structured workflow and templates for designing and programmatically applying ClickHouse database schemas using Node.js. It follows best practices for secret management and references official libraries. A minor risk was identified regarding the potential for SQL injection if the agent automates DDL execution based on unvalidated user input.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at 0d57af8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 4 months ago
What it can do
Reads files Edits files Runs commands
version
1.7.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
[
  "saas",
  "database",
  "analytics",
  "clickhouse",
  "olap"
]
All 5 allowed tools
ReadWriteEditBash(npm:*)Grep
Other metadata
compatibility
Designed for Claude Code

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/clickhouse-core-workflow-a