jaffle_shop_duckdb icon indicating copy to clipboard operation
jaffle_shop_duckdb copied to clipboard

Constraint application of primary and foreign keys

Open matinnuhamunada opened this issue 1 year ago • 0 comments

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:

matinnuhamunada avatar Feb 28 '23 09:02 matinnuhamunada