duckdb

Use when writing DuckDB SQL, using .duckdb files, duckdb imports, analytical queries, CSV/Parquet/JSON ingestion, ETL pipelines, extensions, client APIs, configuration, or performance tuning.

9 stars

Best use case

duckdb is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Use when writing DuckDB SQL, using .duckdb files, duckdb imports, analytical queries, CSV/Parquet/JSON ingestion, ETL pipelines, extensions, client APIs, configuration, or performance tuning.

Teams using duckdb should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/duckdb/SKILL.md --create-dirs "https://raw.githubusercontent.com/cofin/flow/main/plugins/flow/skills/duckdb/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/duckdb/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How duckdb Compares

Feature / AgentduckdbStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Use when writing DuckDB SQL, using .duckdb files, duckdb imports, analytical queries, CSV/Parquet/JSON ingestion, ETL pipelines, extensions, client APIs, configuration, or performance tuning.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# DuckDB

## Overview

DuckDB is an in-process analytical database with rich SQL dialect, first-class support for Parquet/CSV/JSON, and client APIs for Python, Node.js, Rust, Java, R, Go, WASM, and more. It excels at OLAP workloads, local data exploration, embedded analytics, and data engineering pipelines across local and cloud data sources.

## References Index

For detailed guides and patterns, refer to the following documents in `references/`:

- **[Core DuckDB](references/core.md)**
  - SQL dialect highlights, data import/export, configuration, and key SQL patterns.
- **[Advanced SQL Patterns](references/sql_patterns.md)**
  - QUALIFY, COLUMNS(*), EXCLUDE/REPLACE/RENAME, list comprehensions, structs, maps, PIVOT/UNPIVOT, ASOF joins, UNION BY NAME, recursive CTEs, GROUP BY ALL, SAMPLE, string slicing, lambda functions.
- **[Performance Tuning](references/performance.md)**
  - EXPLAIN ANALYZE, storage inspection, pushdown optimizations, parallel execution, memory management, Parquet performance, partition pruning, bulk loading, indexing.
- **[Data Engineering](references/data_engineering.md)**
  - Multi-source reads (CSV, Parquet, JSON, Excel, SQLite, PostgreSQL, MySQL), httpfs/S3/GCS/Azure, glob patterns, Delta Lake, Iceberg, partitioned output, ETL patterns, cross-database queries, secrets management.
- **[Python Client](references/python_client.md)**
  - Connection management, DataFrame integration, relational API, and parameter binding.
- **[Client Connections](references/connections.md)**
  - Node.js, Rust, Java/JDBC, R/dbplyr, Go, WASM, ADBC (Arrow), ODBC driver setup and usage.
- **[Key Function Reference](references/functions.md)**
  - Aggregates, date/time, string, list, struct, map, spatial, and full-text search functions.
- **[Extension Development](references/extensions.md)**
  - Building, testing, and distributing DuckDB C++ extensions.
- **[CLI](references/cli.md)**
  - Interactive shell usage, dot-commands, and scripting patterns.
- **[Configuration & Administration](references/configuration.md)**
  - Pragmas, SET statements, database files/WAL/checkpointing, catalog inspection, extension management, cloud credentials, .duckdbrc startup config.

---

<workflow>

## Key SQL Dialect Features

- `SELECT * EXCLUDE (col)` -- select all columns except specific ones
- `SELECT COLUMNS('pattern')` -- select columns matching a regex
- `PIVOT` / `UNPIVOT` -- built-in pivot support
- `LIST`, `STRUCT`, `MAP` nested types with full query support
- `GROUP BY ALL`, `ORDER BY ALL` -- automatic grouping/ordering
- Friendly SQL: `FROM tbl SELECT col` syntax, implicit `SELECT *`

</workflow>

---

## Quick Start

<example>

```python
import duckdb
con = duckdb.connect()  # in-memory
result = con.sql("SELECT 42 AS answer").fetchall()
```

```bash
# CLI
duckdb mydb.duckdb "SELECT * FROM read_parquet('data/*.parquet')"
```

</example>

---

## Official References

- DuckDB documentation: <https://duckdb.org/docs/>
- Python API: <https://duckdb.org/docs/api/python/overview>
- Extensions: <https://duckdb.org/docs/extensions/overview>
- CLI: <https://duckdb.org/docs/api/cli/overview>
- Extension template: <https://github.com/duckdb/extension-template>

## Shared Styleguide Baseline

- Use shared styleguides for generic language/framework rules to reduce duplication in this skill.
- [General Principles](https://github.com/cofin/flow/blob/main/templates/styleguides/general.md)
- [PostgreSQL](https://github.com/cofin/flow/blob/main/templates/styleguides/databases/postgres_psql.md)
- Keep this skill focused on tool-specific workflows, edge cases, and integration details.

<guardrails>
## Guardrails

Add guardrails instructions here.
</guardrails>

<validation>
## Validation

Add validation instructions here.
</validation>

Related Skills

flow-memory-keeper

9
from cofin/flow

Use at task, phase, flow, sync, archive, finish, revise, or failure checkpoints to keep Flow specs clean, capture learnings and failures, elevate durable patterns, and refine this skill with project-specific nuances

vue

9
from cofin/flow

Use when editing Vue projects, .vue files, vue.config.js, Vue 3 components, Composition API, <script setup>, SFC state, deployment workflows, or Vue CI configuration.

vite

9
from cofin/flow

Use when editing Vite projects, vite.config.ts, vite.config.js, Vite plugins, HMR, asset bundling, frontend build settings, deployment config, or Litestar/Vite integration.

uvicorn

9
from cofin/flow

Use when deploying ASGI apps with uvicorn, editing uvicorn CLI commands, Config or Server usage, workers, reload, event loop selection, SSL, lifespan, logging, or development server behavior.

tracer

9
from cofin/flow

Use when tracing execution paths, mapping dependencies, understanding unfamiliar code, following data flow, investigating end-to-end behavior, debugging call chains, or deciding which files to read next.

testing

9
from cofin/flow

Use when writing or refactoring tests, editing test_*.py, *.test.ts, *.spec.ts, conftest.py, vitest.config.ts, pytest fixtures, mocks, coverage, async tests, anyio, or test failure debugging.

terraform

9
from cofin/flow

Use when creating, adopting, refactoring, or operating Terraform, *.tf files, .terraform.lock.hcl, terragrunt.hcl, root modules, backends, state, workspaces, imports, CI plan/apply, tests, or policy checks.

tanstack

9
from cofin/flow

Use when editing TanStack code, @tanstack imports, useQuery, createRouter, React Query, TanStack Router, Table, Form, Store, file-based routing, data fetching, or SPA state management.

tailwind

9
from cofin/flow

Use when styling with Tailwind CSS, editing tailwind.config.ts, tailwind.config.js, @tailwind directives, utility classes, responsive layouts, @apply, cn(), @theme config, dark mode, or forms.

svelte

9
from cofin/flow

Use when editing Svelte components, .svelte files, svelte.config.js, Svelte 5 runes, $state, $derived, SvelteKit, component state, or migrating away from Svelte 4 patterns.

sqlserver

9
from cofin/flow

Use when writing T-SQL, editing SQL Server .sql files, using sqlcmd, SQL Server connection strings, stored procedures, execution plans, indexes, Always On, JSON, security, or connector code.

sqlalchemy

9
from cofin/flow

Use when editing SQLAlchemy code, sqlalchemy imports, mapped_column, DeclarativeBase, ORM models, relationships, select() queries, async sessions, engines, events, or migrations.