Skip to main content

connections

Operations on a connections resource.

Overview

Nameconnections
TypeResource
Iddatabricks_workspace.unitycatalog.connections

Fields

NameDatatype
namestring
commentstring
connection_idstring
connection_typestring
created_atinteger
created_bystring
credential_typestring
full_namestring
metastore_idstring
optionsobject
ownerstring
propertiesobject
provisioning_infoobject
read_onlyboolean
securable_kindstring
securable_typestring
updated_atinteger
updated_bystring
urlstring

Methods

NameAccessible byRequired ParamsDescription
getSELECTname, deployment_nameGets a connection from it's name.
listSELECTdeployment_nameList all connections.
createINSERTdeployment_nameCreates a new connection
deleteDELETEname, deployment_nameDeletes the connection that matches the supplied name.
updateUPDATEname, deployment_nameUpdates the connection that matches the supplied name.

SELECT examples

SELECT
name,
comment,
connection_id,
connection_type,
created_at,
created_by,
credential_type,
full_name,
metastore_id,
options,
owner,
properties,
provisioning_info,
read_only,
securable_kind,
securable_type,
updated_at,
updated_by,
url
FROM databricks_workspace.unitycatalog.connections
WHERE deployment_name = '{{ deployment_name }}';

INSERT example

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

/*+ create */
INSERT INTO databricks_workspace.unitycatalog.connections (
deployment_name,
data__name,
data__connection_type,
data__options,
data__read_only,
data__comment,
data__properties
)
SELECT
'{{ deployment_name }}',
'{{ name }}',
'{{ connection_type }}',
'{{ options }}',
'{{ read_only }}',
'{{ comment }}',
'{{ properties }}'
;

UPDATE example

Updates a connections resource.

/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_workspace.unitycatalog.connections
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE name = '{{ name }}' AND
deployment_name = '{{ deployment_name }}';

DELETE example

Deletes a connections resource.

/*+ delete */
DELETE FROM databricks_workspace.unitycatalog.connections
WHERE name = '{{ name }}' AND
deployment_name = '{{ deployment_name }}';