Skills Plugins MCP Prompt Model 博客 我的中心
開発 #python #data #database #ai

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 when: user wants SQL on parquet/csv/files or across remote analytical sources; uses ClickHouse SQL features (window functions, windowFunnel, geoToH3, JSON path ops, Session, parametrized queries); imports `chdb` or calls `chdb.query()`. SKIP this skill for pandas-style DataFrame method-chaining (use chdb-datastore instead) or ClickHouse server administration.

DeepseekModel キュレーション済みスキル 品質 優秀 · 90 v1.0.0

取得

https://deepseekmodel.com/api/download.php?id=clickhouse-agent-skills-skills-chdb-sql-skill-md&format=skill
ダウンロード .skill 標準形式。system_prompt と model_config を収録し、任意の Agent で利用可能
.skill ファイルの system_prompt フィールドの実際の内容。
name chdb-sql description 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 when: user wants SQL on parquet/csv/files or across remote analytical sources; uses ClickHouse SQL features (window functions, windowFunnel, geoToH3, JSON path ops, Session, parametrized queries); imports `chdb` or calls `chdb.query()`. SKIP this skill for pandas-style DataFrame method-chaining (use chdb-datastore instead) or ClickHouse server administration. 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 SQL — ClickHouse in Your Python Process Run ClickHouse SQL directly in Python — no server needed. Query local files, remote databases, and cloud storage with full ClickHouse SQL power. pip install chdb Decision Tree: Pick the Right API 1. One-off query on files or databases → chdb.query() 2. Multi-step analysis with tables → Session 3. DB-API 2.0 connection → chdb.connect() 4. Pandas-style DataFrame operations → Use chdb-datastore skill instead chdb.query() — One Line, Any Data import chdb chdb.query( "SELECT * FROM file('data.parquet', Parquet) WHERE price > 100 LIMIT 10" ) # local files chdb.query( "SELECT * FROM mysql('db:3306', 'shop', 'orders', 'root', 'pass')" ) # databases chdb.query( "SELECT * FROM s3('s3://bucket/data.parquet', NOSIGN) LIMIT 10" ) # cloud storage chdb.query( "SELECT * FROM deltaLake('s3://bucket/delta/table', NOSIGN) LIMIT 10" ) # data lakes # Cross-source join chdb.query( """ SELECT u.name, o.amount FROM mysql('db:3306', 'crm', 'users', 'root', 'pass') AS u JOIN file('orders.parquet', Parquet) AS o ON u.id = o.user_id ORDER BY o.amount DESC """ ) data = { "name" : [ "Alice" , "Bob" ], "score" : [ 95 , 87 ]} chdb.query( "SELECT * FROM Python(data) ORDER BY score DESC" ) # Python data df = chdb.query( "SELECT * FROM numbers(10)" , "DataFrame" ) # output formats chdb.query( "SELECT toDate({d:String}) + number FROM numbers({n:UInt64})" , "DataFrame" , params={ "d" : "2025-01-01" , "n" : 30 }) # parametrized Table functions → table-functions.md | SQL functions → sql-functions.md | Full API → api-reference.md Session — Stateful Analysis Pipelines from chdb import session as chs sess = chs.Session( "./analytics_db" ) # persistent; Session() for in-memory sess.query( "CREATE TABLE users ENGINE=MergeTree() ORDER BY id AS SELECT * FROM mysql('db:3306','crm','users','root','pass')" ) sess.query( "CREATE TABLE events ENGINE=MergeTree() ORDER BY (ts,user_id) AS SELECT * FROM s3('s3://logs/events/*.parquet',NOSIGN)" ) sess.query( """ SELECT u.country, count() AS cnt, uniqExact(e.user_id) AS users FROM events e JOIN users u ON e.user_id = u.id WHERE e.ts >= today() - 7 GROUP BY u.country ORDER BY cnt DESC """ , "Pretty" ).show() sess.close() Connection API (DB-API 2.0) from chdb import dbapi conn = dbapi.connect() cur = conn.cursor() cur.execute( "SELECT * FROM file('data.parquet', Parquet) WHERE value > 100" ) print (cur.fetchall()) cur.close() conn.close() Troubleshooting Problem Fix ImportError: No module named 'chdb' pip install chdb DB::Exception: FILE_NOT_FOUND Check file path; use absolute path or verify cwd DB::Exception: Unknown table function Check function name spelling (e.g., deltaLake not deltalake ) Connection refused to remote DB Check host:port format; ensure remote DB allows connections Environment check Run python scripts/verify_install.py (from skill directory) References API Reference — query/Session/connect signatures Table Functions — All ClickHouse table functions SQL Functions — Commonly used SQL functions Examples — 9 runnable examples with expected output Official Docs Note: This skill teaches how to use chdb SQL. For pandas-style operations, use the chdb-datastore skill. For contributing to chdb source code, see CLAUDE.md in the project root.
このスキルを起動するキーワード。クリックでコピーできます。

このスキルにはトリガーワードがありません。

ダウンロードした .skill に含まれるフィールド。
フィールド 説明
formatフォーマット識別子(skill/v1)
skill_idスキル固有 ID
nameスキル名
versionバージョン
description説明
categoryカテゴリ(配列)
trigger_wordsトリガーワード
tagsタグ
sourceソース
source_urlソース URL(本ページ)
exported_atエクスポート日時(ダウンロード毎)
system_promptシステムプロンプト本文
model_configモデル設定:provider / model / temperature / max_tokens / top_p
examplesサンプル
install_guide各プラットフォームの導入説明(Coze / Dify / Claude / カスタム)
同じスキルを各プラットフォーム形式で出力できます。
.skill 標準形式。system_prompt と model_config を収録し、任意の Agent で利用可能 ダウンロード
.skillpro 拡張形式。scripts / tools / dependencies / hooks を含む ダウンロード
.json 純粋な JSON 出力。system_prompt とモデル設定のみ ダウンロード
Coze frontmatter 付き Markdown。Coze へのインポート用 ダウンロード
Dify Dify DSL。アプリ作成後にそのままインポート ダウンロード

每日精选 Skill 推荐,免费送到你邮箱

输入邮箱,每天接收一个精选 AI Agent 技能推荐。完全免费,持续更新。

提交后我们会发送一封确认邮件,点击邮件里的链接才会开始收信。

完全免费,取消任意时间。我们不会发送垃圾邮件。