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:
|
- name: order_id |
|
tests: |
|
- unique |
|
- not_null |
|
description: This is a unique identifier for an order |
|
|
|
- name: customer_id |
|
description: Foreign key to the customers table |
|
tests: |
|
- not_null |
|
- relationships: |
|
to: ref('customers') |
|
field: customer_id |
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:
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:
jaffle_shop_duckdb/models/schema.yml
Lines 36 to 48 in a6ea10d
When I open the resulting
.dbfile in DBeaver or Metabase, the constraints doesn't seem to be implemented.My question is:
.sqlscripts?PS:
I also found these tools: