clickhouse-query

Run ad-hoc ClickHouse queries with read-only defaults and JSON output.

7.2k|732|Updated Oct 11, 2022
One-click install
npx skills add https://github.com/civitai/civitai --skill clickhouse-query
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clickhouse-query
Source: https://github.com/civitai/civitai/tree/main/.claude/skills/clickhouse-query
Command: npx skills add https://github.com/civitai/civitai --skill clickhouse-query

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @clickhouse/client.

What problem does it solve?

Running ad-hoc ClickHouse queries directly against production data can be risky and error-prone. This skill provides a safe, configurable interface that enables analytics teams and engineers to explore data without unintended writes, enabling faster validation and debugging.

Core Features & Use Cases

  • Read-only by default to prevent data mutations, with an explicit --writable option for trusted operations.
  • Supports query explanations, file-based queries, timeouts, and JSON-formatted results for automation and dashboards.
  • Use Case: Validate event counts, audit data quality, and prototype ad-hoc analyses against your ClickHouse deployment.

Quick Start

Run a sample query against the ClickHouse instance using the included query.mjs script.

Frequently Asked Questions about clickhouse-query

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely run read-only ClickHouse queries for ad-hoc analytics?

To safely run ClickHouse queries for analytics, use a tool that defaults to read-only mode. This Skill executes ad-hoc queries against your configured server while preventing unintended data mutations during validation and debugging.

How do I enable writable mode to execute INSERT or UPDATE statements in ClickHouse?

Writable mode is guarded by an explicit permission flag. You must opt-in to the writable option to perform trusted mutations, ensuring default analytics operations remain strictly read-only and safe against accidental writes.

Can I run EXPLAIN plans and load queries from files using the ClickHouse client?

Yes, the ClickHouse client supports executing EXPLAIN plans to analyze query performance and reading query statements directly from files. This allows you to validate event counts and prototype complex queries easily.

How do I enforce query timeouts and get JSON results from ClickHouse analytics queries?

The Skill enforces configurable query timeouts and returns JSON-formatted results. This prevents long-running processes from blocking your server and enables seamless integration with automation scripts or dashboards.

Do I need environment configuration to connect to a ClickHouse database?

Yes, the Skill reads environment configuration to connect to your ClickHouse deployment. Setting up environment variables for your server credentials is a prerequisite before executing analytics, debugging, or data validation queries.

What is the best way to validate data quality and audit event counts in ClickHouse?

The best way to audit data quality in ClickHouse is to run ad-hoc queries in a read-only environment. This Skill provides a configurable interface to explore production data, validate event counts, and debug issues without unintended writes.