motherduckdb/agent-skills / plugins/motherduck-skills-claude/skills/motherduck-duckdb-sql
motherduck-duckdb-sql
VerifiedLook up or repair DuckDB SQL syntax and verify MotherDuck-specific command and feature support.
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. - 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
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |