Skip to main content

connections

Creates, updates, deletes, gets or lists a connections resource.

Overview

Nameconnections
TypeResource
Iddatabricks_workspace.unitycatalog.connections

Fields

The following fields are returned by SELECT queries:

The connection was successfully retrieved.

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

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdeployment_nameGets a connection from it's name.
listselectdeployment_nameList all connections.
createinsertdeployment_nameCreates a new connection
updateupdatedeployment_nameUpdates the connection that matches the supplied name.
deletedeletedeployment_nameDeletes the connection that matches the supplied name.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)

SELECT examples

Gets a connection from it's name.

SELECT
name,
connection_id,
metastore_id,
full_name,
comment,
connection_type,
created_at,
created_by,
credential_type,
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 }}' -- required;

INSERT examples

Creates a new connection

INSERT INTO databricks_workspace.unitycatalog.connections (
data__name,
data__connection_type,
data__read_only,
data__comment,
data__options,
data__properties,
deployment_name
)
SELECT
'{{ name }}',
'{{ connection_type }}',
'{{ read_only }}',
'{{ comment }}',
'{{ options }}',
'{{ properties }}',
'{{ deployment_name }}'
RETURNING
name,
connection_id,
metastore_id,
full_name,
comment,
connection_type,
created_at,
created_by,
credential_type,
options,
owner,
properties,
provisioning_info,
read_only,
securable_kind,
securable_type,
updated_at,
updated_by,
url
;

UPDATE examples

Updates the connection that matches the supplied name.

UPDATE databricks_workspace.unitycatalog.connections
SET
data__owner = '{{ owner }}',
data__new_name = '{{ new_name }}',
data__options = '{{ options }}'
WHERE
deployment_name = '{{ deployment_name }}' --required
RETURNING
name,
connection_id,
metastore_id,
full_name,
comment,
connection_type,
created_at,
created_by,
credential_type,
options,
owner,
properties,
provisioning_info,
read_only,
securable_kind,
securable_type,
updated_at,
updated_by,
url;

DELETE examples

Deletes the connection that matches the supplied name.

DELETE FROM databricks_workspace.unitycatalog.connections
WHERE deployment_name = '{{ deployment_name }}' --required;