motherduck-model-data

Designs analytical database schemas and SQL data models in MotherDuck with a file-based project scaffold.

9|Updated Feb 16, 2026
One-click install
npx skills add https://github.com/mathisdrn/orca --skill motherduck-model-data-mathisdrn
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: motherduck-model-data
Source: https://github.com/mathisdrn/orca/tree/main/.agents/skills/motherduck-model-data
Command: npx skills add https://github.com/mathisdrn/orca --skill motherduck-model-data-mathisdrn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Designing analytical schemas in MotherDuck often leads to ad-hoc, unreviewable SQL and poorly organized transformations. This Skill structures schema design and data modeling work into a versionable, file-based SQL project with a manifest defining the model DAG. ## Core Features & Use Cases - Project Scaffold Generation: Creates SQL files organized by lifecycle stage (raw, staging, analytics) plus a model_manifest.yml defining dependencies and materialization. - OLAP-First Schema Design: Produces wide denormalized tables, star schemas, and pre-aggregated serving tables with explicit types, NOT NULL constraints, and comments. - Use Case: You have raw HackerNews data loaded in MotherDuck and need staging and analytics layers. The Skill inspects source tables, then generates raw/staging/analytics SQL models with a manifest mapping the dependency DAG, ready to run or hand to dbt. ## Quick Start Design a star schema in MotherDuck for my orders and customers tables, organized as a raw, staging, and analytics SQL project with a model manifest.

Frequently Asked Questions about motherduck-model-data

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design a star schema in MotherDuck?▼

Create dimension tables (dim_customers, dim_products, dim_dates) and a fact table (fact_orders) using CREATE TABLE with explicit types and NOT NULL constraints. Add table and column comments, use fully qualified names, and organize models into raw, staging, and analytics databases.

Should I use views or CTAS tables for analytical models in DuckDB?▼

Use views when queries are fast (under 1s) and must reflect the latest data. Use CTAS tables with CREATE OR REPLACE when queries are expensive (over 5s), accessed frequently, or when periodic rebuilds are acceptable.

Does MotherDuck enforce primary key and foreign key constraints?▼

No. MotherDuck only enforces NOT NULL constraints; PRIMARY KEY, UNIQUE, and CHECK are informational only, and FOREIGN KEY is not supported. Use NOT NULL aggressively and handle uniqueness in your transformation logic.

What data types should I use for IDs, money, and timestamps in DuckDB?▼

Use VARCHAR for IDs to handle UUIDs and external keys, DECIMAL(18,2) for money to avoid floating-point rounding errors, and TIMESTAMP or TIMESTAMPTZ for times to preserve date arithmetic. Use BOOLEAN for flags rather than integer 0/1.

When should I skip the SQL project scaffold for data modeling?▼

Skip the scaffold when the request is a single table, a quick DDL statement, or an ad-hoc exploration query. The file-based scaffold with a manifest is the default only for multi-table, multi-stage transformation work with dependencies.