dbt-labs / dbt-labs/jaffle_shop_duckdb

Constraint application of primary and foreign keys

Open
#47 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
288
Forks
235
PR merge metrics
No merged PRs in 30d

Description

Hi, I'm quite new to DBT and DuckDB. I'm still a bit confused about setting up primary and foreign keys in the models.

I saw that this is how it is being implemented in the models:
https://github.com/dbt-labs/jaffle_shop_duckdb/blob/a6ea10d9bd8c6f3803ab1b19a4eb20be494cffc3/models/schema.yml#L36-L48

When I open the resulting `.db` file in [DBeaver](https://dbeaver.io/) or [Metabase](https://www.metabase.com/), the constraints doesn't seem to be implemented.

My question is:
* Is this something that is expected in DBT or am I missing something?
* Why don't we implement this in the `.sql` scripts?

**PS:**
I also found these tools:
* [dbt_constraints](https://github.com/Snowflake-Labs/dbt_constraints) - *Not sure if it support duckdb*
* [dbt-metabase](https://github.com/gouline/dbt-metabase) - works great

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.