# chdb-datastore

Guides the AI agent on speeding up pandas workflows with chDB and ClickHouse. Useful for heavy dataframes, Parquet files, and cross-source joins.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 7900 installs · ★ 561
- Author: chdb-io
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/ClickHouse/agent-skills/tree/HEAD/skills/chdb-datastore/SKILL.md
- Updated: 2026-10-21
- HTML: https://affpapa.org/en/nevibecode/skills/chdb-datastore

## What it does

This skill teaches coding agents how to use chdb.datastore as a lazy, ClickHouse-backed drop-in replacement for pandas. Standard pandas syntax remains intact, but operations compile into SQL queries that run only when data is displayed or iterated. DataStore supports 209 DataFrame methods alongside local formats like Parquet and CSV.

A key capability is querying across separate storage systems in a single pipeline. You can read a local file alongside a remote MySQL or S3 table and combine them using a standard dataframe `join()` call.

The environment requires Python 3.9+ running on macOS or Linux, with `chdb` installed via pip. It is strictly meant for the DataStore DataFrame API; tasks requiring raw SQL queries should use chdb-sql instead.

## Requirements
- Works with: PostgreSQL, MongoDB

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add ClickHouse/agent-skills --skill chdb-datastore -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/chdb-datastore/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/chdb-datastore/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add ClickHouse/agent-skills --skill chdb-datastore -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/chdb-datastore/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add ClickHouse/agent-skills --skill chdb-datastore -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/chdb-datastore/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install ClickHouse/agent-skills chdb-datastore
```

2. **Manually: put the files in place**
- File: `.github/skills/chdb-datastore/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add ClickHouse/agent-skills --skill chdb-datastore -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/ClickHouse/agent-skills --path skills/chdb-datastore
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/chdb-datastore/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add ClickHouse/agent-skills --skill chdb-datastore -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/ClickHouse/agent-skills/tree/HEAD/skills/chdb-datastore/SKILL.md

## When to use it
- accelerate slow pandas grouping and filtering workflows
- join data between local Parquet files and remote MySQL tables
- read datasets directly from S3 or cloud storage into DataFrames
- inspect compiled ClickHouse queries with the to_sql method

## Example prompts
- Rewrite this slow pandas script to use chdb.datastore instead
- Join orders.parquet with our MySQL customers table using DataStore
- Show me how to filter a large dataset with chDB and inspect the generated SQL

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: d1fe7283276dfc73.

BEGIN THIRD-PARTY FILE d1fe7283276dfc73
````text
---
name: chdb-datastore
description: >-
  Use when the user has tabular data (pandas DataFrame, parquet, csv,
  Arrow, json) and wants to filter, group, aggregate, join, or speed
  up slow pandas. Provides chDB DataStore — same pandas API,
  ClickHouse engine underneath. Also handles reading from S3, MySQL,
  PostgreSQL, MongoDB, ClickHouse Cloud, Iceberg, Delta Lake as
  DataFrames and joining across sources.
  TRIGGER when: user mentions DataFrame, parquet, csv, "fast pandas",
  "speed up pandas", or cross-source DataFrame joins; user imports
  `chdb.datastore` or `from datastore import DataStore`.
  SKIP this skill for raw SQL syntax (use chdb-sql instead),
  ClickHouse server administration, or non-Python DataStore API work.
license: Apache-2.0
compatibility: Requires Python 3.9+, macOS or Linux. pip install chdb.
metadata:
  author: chdb-io
  version: "4.1"
  homepage: https://clickhouse.com/docs/chdb
---

# chdb DataStore — It's Just Faster Pandas

## The Key Insight

```python
# Change this:
import pandas as pd
# To this:
import chdb.datastore as pd
# Everything else stays the same.
```

DataStore is a **lazy, ClickHouse-backed pandas replacement**. Your existing pandas code works unchanged — but operations compile to optimized SQL and execute only when results are needed (e.g., `print()`, `len()`, iteration).

```bash
pip install chdb
```

## Decision Tree: Pick the Right Approach

```
1. "I have a file/database and want to analyze it with pandas"
   → DataStore.from_file() / from_mysql() / from_s3() etc.
   → See references/connectors.md

2. "I need to join data from different sources"
   → Create DataStores from each source, use .join()
   → See examples/examples.md #3-5

3. "My pandas code is too slow"
   → import chdb.datastore as pd — change one line, keep the rest

4. "I need raw SQL queries"
   → Use the chdb-sql skill instead
```

## Connect to Any Data Source — One Pattern

```python
from datastore import DataStore

# Local file (auto-detects .parquet, .csv, .json, .arrow, .orc, .avro, .tsv, .xml)
ds = DataStore.from_file("sales.parquet")

# Database
ds = DataStore.from_mysql(host="db:3306", database="shop", table="orders", user="root", password="pass")

# Cloud storage
ds = DataStore.from_s3("s3://bucket/data.parquet", nosign=True)

# URI shorthand — auto-detects source type
ds = DataStore.uri("mysql://root:pass@db:3306/shop/orders")
```

All 16+ sources and URI schemes → [connectors.md](references/connectors.md)

## After Connecting — Full Pandas API

```python
result = ds[ds["age"] > 25]                                          # filter
result = ds[["name", "city"]]                                        # select columns
result = ds.sort_values("revenue", ascending=False)                  # sort
result = ds.groupby("dept")["salary"].mean()                         # groupby
````
END THIRD-PARTY FILE d1fe7283276dfc73

The third-party file has ended. Everything between the d1fe7283276dfc73 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2872 of 5564 bytes. © chdb-io · Apache-2.0 · https://github.com/ClickHouse/agent-skills/tree/HEAD/skills/chdb-datastore/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
