chdb-sql
Use when the user wants to run SQL — especially analytical SQL — on local files (parquet/csv/json), URLs, S3 paths, or remote databases (Postgres, MySQL, MongoDB, ClickHouse Cloud, Iceberg, Delta Lake) without setting up a server. Provides chDB — embedded ClickHouse SQL in Python with 1000+ functions, Session for stateful multi-step pipelines, parametrized queries, and cross-source joins via `s3()`, `mysql()`, `postgresql()`, `iceberg()`, `deltaLake()`, `remoteSecure()` table functions. TRIGGER
Security Assessment
About chdb-sql
chDB brings the ClickHouse SQL engine into a Python process, letting analysts run analytical SQL over local files, URLs, cloud object storage, and remote databases without standing up a server. It targets workflows where you want to query parquet, CSV, or JSON directly, join across heterogeneous sources, or reach into Postgres, MySQL, MongoDB, ClickHouse Cloud, Iceberg, or Delta Lake, all from Python with the full ClickHouse function library (1000+ functions) available.
The skill lays out a decision tree for picking the right API: chdb.query() for one-off queries against files or databases; a Session for stateful, multi-step pipelines that create and reuse MergeTree tables; and chdb.connect() for a DB-API 2.0 connection with cursors. Table functions such as s3(), mysql(), postgresql(), iceberg(), deltaLake(), and remoteSecure() expose external data as queryable tables, so a single SELECT can join a MySQL table against a parquet file. Queries can emit different output formats (for example a pandas DataFrame) and support parametrized placeholders like {n:UInt64} for safe value substitution, and in-process Python data can be queried via the Python() table function.
Use it when you want SQL, especially analytical SQL with window functions, windowFunnel, geoToH3, or JSON path operators, over files or across remote analytical sources without server setup. It explicitly defers to the companion chdb-datastore skill for pandas-style DataFrame method chaining, and is not intended for ClickHouse server administration. Installation is a single pip install chdb on Python 3.9+ (macOS or Linux). A troubleshooting table covers common errors such as a missing module, FILE_NOT_FOUND, unknown table-function spelling, and remote connection refusals, and the skill points to bundled references for the API, table functions, SQL functions, and runnable examples.
FAQ
What do I need to install to use chDB?
Just run pip install chdb. It requires Python 3.9 or newer on macOS or Linux, and runs entirely in-process with no separate server.
Can I join data across a database and a local file?
Yes. Table functions like mysql() and file() can be used together in a single query, for example joining a MySQL users table against an orders.parquet file on a shared key.
When should I use a Session instead of chdb.query()?
Use a Session for multi-step analysis where you create tables and reuse them across queries; chdb.query() is for one-off queries. Session with a path persists to disk while Session() is in-memory.
How do parametrized queries work?
You pass a params dict and reference placeholders with typed syntax such as {d:String} or {n:UInt64} in the SQL, for example params with d set to a date and n set to a number.
When should I not use this skill?
Skip it for pandas-style DataFrame method-chaining, where you should use the chdb-datastore skill instead, and for ClickHouse server administration.
Install chdb-sql
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
clickhouse/agent-skills