DuckDB Semantic Views

The semantic layer for your

A Semantic Layer sits between your raw tables and the people querying them. Instead of everyone writing their own SUM(amount) and hoping they GROUP BY the same columns, you define each metric and dimension once, in one place. Analysts pick the ones they want; the system assembles the SQL.

Snowflake and Databricks, along with dbt Cloud, Cube.dev and others, all ship semantic layers in different forms. Snowflake has Semantic Views, Databricks calls them Metric Views, both as a SQL syntax sugar for a special kind of flexible view-like interface over aggregated metrics and dimensions. This extension brings the same idea to DuckDB, using DDL syntax modeled closely on Snowflake’s CREATE SEMANTIC VIEW.

Getting started

Install the extension, create your first semantic view, and run a query in 5 minutes.

Getting Started
Multi-table semantic views

Model relationships between tables and query across them.

Multi-Table Semantic Views
Building a complete model

Facts, derived metrics, and iterative model refinement in 15 minutes.

Building a Complete Model
DDL reference

Full syntax for CREATE SEMANTIC VIEW and related DDL.

CREATE SEMANTIC VIEW
How-to guides

Modeling, advanced metrics, data sources, materializations, YAML definitions, and more.

How-To Guides
Snowflake comparison

Feature-by-feature comparison with Snowflake’s CREATE SEMANTIC VIEW.

Snowflake Comparison