chdb-sql

Embed ClickHouse SQL in Python to query local files, URLs, S3, and remote databases.

512|33|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/ClickHouse/agent-skills --skill chdb-sql
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: chdb-sql
Source: https://github.com/ClickHouse/agent-skills/tree/main/skills/chdb-sql
Command: npx skills add https://github.com/ClickHouse/agent-skills --skill chdb-sql

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Run SQL analytics locally in Python without a server by embedding ClickHouse SQL through chdb to query local files (parquet, csv, json), URLs, S3 paths, or remote databases such as Postgres, MySQL, MongoDB, ClickHouse Cloud, Iceberg, and Delta Lake.

Core Features & Use Cases

  • Embeds ClickHouse SQL in Python via chdb.query() and Session for multi-step pipelines with parametrized queries.
  • Access external data sources with table functions like file(), s3(), mysql(), postgresql(), remoteSecure(), iceberg(), deltaLake(), enabling cross-source joins.
  • Outputs results in CSV, DataFrame, or other formats to integrate with Python data workflows; suitable for ad-hoc analytics, lightweight ETL, and data discovery.

Quick Start

Install chdb and run a simple query against a local Parquet file to verify the setup.

Frequently Asked Questions about chdb-sql

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

FAQPage Schema
How do I run SQL queries on local Parquet and CSV files in Python without a server?

You can query local Parquet, CSV, and JSON files by embedding ClickHouse SQL through chdb.query() with the file() table function, which processes data entirely in Python without requiring a dedicated database server.

Can I join data from S3 and PostgreSQL in a single Python SQL query?

Yes, you can join data from S3 and PostgreSQL in a single query by using chdb's table functions like s3() and postgresql() within your SQL statement. This enables cross-source joins directly in Python, combining remote databases and cloud storage without moving data manually.

Does chdb support parametrized queries and multi-step data pipelines?

chdb supports parametrized queries and multi-step data pipelines through its Session object, allowing you to maintain state across multiple SQL query executions. This enables complex ETL workflows and multi-step analytics directly in Python.

What Python versions and operating systems are required to run chdb locally?

Running chdb locally requires Python 3.9 or higher and is compatible with macOS or Linux operating systems. You must install the chdb package to start executing embedded ClickHouse SQL queries for local data analytics.

How do I output ClickHouse SQL query results as a Pandas DataFrame in Python?

Output ClickHouse SQL query results as a Pandas DataFrame by specifying the desired format in your chdb.query() call. chdb supports DataFrame outputs alongside CSV and other formats to integrate smoothly with existing Python data workflows and analytics libraries.

What are the limitations of using embedded ClickHouse SQL for data analytics?

Embedded ClickHouse SQL via chdb is designed for ad-hoc analysis and lightweight ETL pipelines rather than concurrent multi-user access. It operates locally within a Python process, making it unsuitable for large-scale distributed workloads or persistent client-server database applications.