The problem I’m having
I use dbt to deploy my models into snowflake. The materialization is set to view. Once they are deployed, I run tasks to create static tables out of them and they are scheduled to run periodically. I want to have the column descriptions for each column in my model and I am usign the .yml file to have the descriptions. I also want to have the constraints like not null, primary key for some columns in my model. I was looking into constraints | dbt Developer Hub documentation and tried to apply the same to one of my model. I am aware the this only works for views as stated in the document. Hence, I changed the materialization to table and mentioned the constraints on few columns. But when checked at snowflake, I can see the column descriptions but not the constraints. Even not null too.
The context of why I’m trying to do this
What I’ve already tried
Some example code or error messages
version: 2
models:
- name: cust_details
description: Customer details table
columns:
- name: cust_id
data_type: varchar
description: customer account id
constraints:
- type: not_null
- type: primary_key
tests:
- unique
- name: cust_name
description: Customer name
- name: cust_phone
description: Customer Phone
Expectation is to have the primary key and not null enabled in snowflake, but it is not the case. Pleae advise. Thanks in advance.