Skip to main content

table_constraints

Operations on a table_constraints resource.

Overview

Nametable_constraints
TypeResource
Iddatabricks_workspace.unitycatalog.table_constraints

SELECT not supported for this resource, see the methods section for supported operations.

Methods

NameAccessible byRequired ParamsDescription
createINSERTdeployment_nameCreates a new table constraint.
deleteDELETEcascade, constraint_name, full_name, deployment_nameDeletes a table constraint.

INSERT example

Use the following StackQL query and manifest file to create a new table_constraints resource.

/*+ create */
INSERT INTO databricks_workspace.unitycatalog.table_constraints (
deployment_name,
data__full_name_arg,
data__constraint
)
SELECT
'{{ deployment_name }}',
'{{ full_name_arg }}',
'{{ constraint }}'
;

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 }}';