Skip to main content

Build

Motherduck Duckdb SQL

MotherDuck Agent SkillsOfficialCertified

Look up or repair DuckDB SQL syntax and verify MotherDuck-specific command and feature support.

  • New
  • v1.0.50
  • Reviewed Jul 21
  • No reviews yet

Getting started

Full instructions

Install 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, and REPLACE.
  • 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, native GEOMETRY, MERGE INTO, or date_trunc return-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 BY joins 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 DATABASE statements as operational SQL with plan-specific retention behavior, not ordinary analytical syntax.
  • Treat INCLUDE_PATTERN as 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's CREATE SECURE VIEW optimizer 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; use COPY FROM DATABASE instead.
  • Use role/grant SQL for governed access and audit it with SHOW ... statements; do not preserve ACCESS ORGANIZATION as 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, and prompt_jev() for typed classification, scoring, yes/no probabilities, and image bounding boxes. See motherduck-query for usage and cost rules.

Workflow

  1. Confirm the connection path and whether the question is about syntax, feature support, or a specific error.
  2. Write or repair the statement in DuckDB SQL first.
  3. Verify any MotherDuck-only command or server-mode limitation against the current docs.
  4. 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.md for DuckDB data types, friendly SQL features, functions, complex types, and common MotherDuck-specific gotchas.

Load related skills only for missing capabilities; reuse established context.

  • motherduck-query for writing and validating analytical SQL against live MotherDuck data
  • motherduck-connect when syntax support depends on PG endpoint versus native DuckDB behavior
  • motherduck-explore when the problem is really missing schema context rather than missing syntax knowledge

Explore more skills

Browse all
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

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.

Install on Skills Hub badge preview
Markdown
[![Install on Skills Hub](https://skills-hub.ai/api/badges/skill/motherduck-duckdb-sql)](https://skills-hub.ai/skills/motherduck-duckdb-sql)
HTML
<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.