table_constraints
Operations on a table_constraints
resource.
Overview
Name | table_constraints |
Type | Resource |
Id | databricks_workspace.unitycatalog.table_constraints |
SELECT
not supported for this resource, see the methods section for supported operations.
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
create | INSERT | deployment_name | Creates a new table constraint. |
delete | DELETE | cascade, constraint_name, full_name, deployment_name | Deletes a table constraint. |
INSERT
example
Use the following StackQL query and manifest file to create a new table_constraints
resource.
- table_constraints
- Manifest
/*+ create */
INSERT INTO databricks_workspace.unitycatalog.table_constraints (
deployment_name,
data__full_name_arg,
data__constraint
)
SELECT
'{{ deployment_name }}',
'{{ full_name_arg }}',
'{{ constraint }}'
;
- name: your_resource_model_name
props:
- name: full_name_arg
value: string
- name: constraint
value:
primary_key_constraint:
name: string
child_columns:
- string
foreign_key_constraint:
name: string
child_columns:
- string
parent_table: string
parent_columns:
- string
named_table_constraint:
name: string
DELETE
example
Deletes a table_constraints
resource.
/*+ delete */
DELETE FROM databricks_workspace.unitycatalog.table_constraints
WHERE cascade = '{{ cascade }}' AND
constraint_name = '{{ constraint_name }}' AND
full_name = '{{ full_name }}' AND
deployment_name = '{{ deployment_name }}';