The documentation for constraints in dbt specifies that the name property is optional. If the name is left out of the definition dbt-fabric throws the following exception.
Database Error in model model1 (models\gold\datamart1\dimensions\table1.sql)
Constraint name cannot be empty. Provide constraint name - column column1_hk and run the project again.
compiled Code at target\run\project1\models\gold\datamart1\dimensions\table1.sql
This was more of a problem when Fabric Data Warehouse prohibited using the same constraint name on multiple objects. This limitation appears to have been removed, at least in regard to tables in different schemas. However, it does not follow the standard and users changing platforms may have issue with this.
@bebemn,
Yes, the limitation still exists within a schema. What would be a good default naming convention for a constraint? {object}{pk/fk/uk}{column name}?
The documentation for constraints in dbt specifies that the name property is optional. If the name is left out of the definition dbt-fabric throws the following exception.
This was more of a problem when Fabric Data Warehouse prohibited using the same constraint name on multiple objects. This limitation appears to have been removed, at least in regard to tables in different schemas. However, it does not follow the standard and users changing platforms may have issue with this.