jaffle_shop_duckdb
jaffle_shop_duckdb copied to clipboard
Constraint application of primary and foreign keys
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 or Metabase, 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 - Not sure if it support duckdb
- dbt-metabase - works great