Look up or repair DuckDB SQL syntax and verify MotherDuck-specific command and feature support.
Getting started
Full instructionsInstall the skill, then ask your AI tool for the task in plain words. The full SKILL.md below shows what it covers.
Instructions: SKILL.mdv1.0.50
DuckDB SQL Reference for MotherDuck
Source Of Truth
- Prefer current DuckDB SQL docs for language features and function semantics.
- Use current MotherDuck SQL docs for MotherDuck-only commands such as shares, secrets, snapshots, and Dive operations.
- MotherDuck can lag upstream DuckDB releases for client compatibility; check MotherDuck version-lifecycle docs before promising newly released DuckDB syntax or types are available.
- If the connection path matters, verify behavior against the current Postgres-endpoint docs before promising server-mode support.
Default Posture
- Write DuckDB SQL, not PostgreSQL SQL, even when the client connects through the Postgres endpoint.
- Prefer fully qualified
"database"."schema"."table"names; they are required once more than one database or share is attached. - Prefer DuckDB-native constructs when they simplify the query:
GROUP BY ALL,QUALIFY,UNION BY NAME,arg_max,EXCLUDE, andREPLACE. - When porting SQL from another engine, translate functions, date arithmetic, identifier quoting, and type casts explicitly instead of assuming compatibility.
- Verify current MotherDuck support before relying on recently released upstream DuckDB features such as
VARIANT, nativeGEOMETRY,MERGE INTO, ordate_truncreturn-type changes. - MotherDuck runs DuckDB 2.0.1 and accepts 1.4.1 through 2.0.1 clients (1.4.0 only in us-east-1; never 2.0.0). Triggers, nested schemas, DuckLake 1.1, and
NEAREST BYjoins in stored views or macros are not available on MotherDuck yet; see the reference's version-sensitive section. - Check whether the statement depends on local files, extension install/load, temporary-table behavior, or other client-only features before claiming it will work in MotherDuck.
- Treat snapshot, restore, and
UNDROP DATABASEstatements as operational SQL with plan-specific retention behavior, not ordinary analytical syntax. - Treat
INCLUDE_PATTERNas whole-table/view filtering on a Share. Row filters, hidden columns, and masking use share secure views (WITH SECURE VIEW ... REPLACES <table> AS (SELECT ...),ALTER SHARE ... ADD|DROP SECURE VIEW), which are unrelated to DuckDB'sCREATE SECURE VIEWoptimizer barrier. - Distinguish physical import (
CREATE DATABASE ... FROM '<file-url>', including a DuckDB file in cloud storage such as's3://bucket/app.db') from zero-copy clone sources. Reject filtered shares and shares with secure views as clone sources; useCOPY FROM DATABASEinstead. - Use role/grant SQL for governed access and audit it with
SHOW ...statements; do not preserveACCESS ORGANIZATIONas the preferred RBAC pattern. - Treat MotherDuck SQL as an additional surface on top of DuckDB SQL, not a replacement for it.
- MotherDuck adds SQL AI functions:
prompt()for generated or structured text,embedding()for vectors, andprompt_jev()for typed classification, scoring, yes/no probabilities, and image bounding boxes. Seemotherduck-queryfor usage and cost rules.
Workflow
- Confirm the connection path and whether the question is about syntax, feature support, or a specific error.
- Write or repair the statement in DuckDB SQL first.
- Verify any MotherDuck-only command or server-mode limitation against the current docs.
- If the user needs exact syntax or function details, open
references/SYNTAX_REFERENCE.md.
References
Read only the reference sections needed for the current task.
- Read
references/SYNTAX_REFERENCE.mdfor DuckDB data types, friendly SQL features, functions, complex types, and common MotherDuck-specific gotchas.
Related Skills
Load related skills only for missing capabilities; reuse established context.
motherduck-queryfor writing and validating analytical SQL against live MotherDuck datamotherduck-connectwhen syntax support depends on PG endpoint versus native DuckDB behaviormotherduck-explorewhen the problem is really missing schema context rather than missing syntax knowledge
Explore more skills
Browse all- Motherduck Design DiveDesign or improve a MotherDuck Dive’s layout, responsive behavior, themes, filters, and visual accessibility.
- Motherduck Build Malleable DiveBuild a generative MotherDuck Dive where a Flight writes a daily briefing and question-to-page specs from a semantic…
- Motherduck Manage GuidesRead or maintain MotherDuck Guides for business definitions, join rules, and reusable warehouse conventions.
- Motherduck Model DataDesign or implement MotherDuck analytical schemas and transformation models, including grain, types, and…
- Motherduck ExploreFind and understand MotherDuck databases, tables, columns, shares, and sample data, including which tables hold a given…
- Motherduck Share DataCreate, consume, or manage MotherDuck data shares, including audience grants, table filters, and refresh policy.
Security
Reviews (0)
More from MotherDuck Agent Skills
View source →Frequently asked questions about motherduck-duckdb-sql
What does the motherduck-duckdb-sql skill do?
Look up or repair DuckDB SQL syntax and verify MotherDuck-specific command and feature support. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the motherduck-duckdb-sql skill?
Run `npx @skills-hub-ai/cli install motherduck-duckdb-sql` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/motherduck-duckdb-sql/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does motherduck-duckdb-sql work with?
motherduck-duckdb-sql runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the motherduck-duckdb-sql skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use motherduck-duckdb-sql after installing it?
In Claude Code, type `/motherduck-duckdb-sql` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the motherduck-duckdb-sql skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.
Badge for your README
Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.
[](https://skills-hub.ai/skills/motherduck-duckdb-sql)<a href="https://skills-hub.ai/skills/motherduck-duckdb-sql"><img src="https://skills-hub.ai/api/badges/skill/motherduck-duckdb-sql" alt="Install on Skills Hub"></a>More options in the badge docs.