Skip to main content

connections

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

Overview

Nameconnections
TypeResource
Iddatabricks_workspace.catalog.connections

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringName of the connection.
connection_idstringUnique identifier of the Connection.
metastore_idstringUnique identifier of parent metastore.
full_namestringFull name of connection.
commentstringUser-provided free-form text description.
connection_typestringThe type of connection. (BIGQUERY, DATABRICKS, GA4_RAW_DATA, GLUE, HIVE_METASTORE, HTTP, MYSQL, ORACLE, POSTGRESQL, POWER_BI, REDSHIFT, SALESFORCE, SALESFORCE_DATA_CLOUD, SERVICENOW, SNOWFLAKE, SQLDW, SQLSERVER, TERADATA, UNKNOWN_CONNECTION_TYPE, WORKDAY_RAAS)
created_atintegerTime at which this connection was created, in epoch milliseconds.
created_bystringUsername of connection creator.
credential_typestringThe type of credential. (ANY_STATIC_CREDENTIAL, BEARER_TOKEN, OAUTH_ACCESS_TOKEN, OAUTH_M2M, OAUTH_MTLS, OAUTH_REFRESH_TOKEN, OAUTH_RESOURCE_OWNER_PASSWORD, OAUTH_U2M, OAUTH_U2M_MAPPING, OIDC_TOKEN, PEM_PRIVATE_KEY, SERVICE_CREDENTIAL, SSWS_TOKEN, UNKNOWN_CREDENTIAL_TYPE, USERNAME_PASSWORD)
optionsobjectA map of key-value properties attached to the securable.
ownerstringUsername of current owner of the connection.
propertiesobjectA map of key-value properties attached to the securable.
provisioning_infoobjectStatus of an asynchronously provisioned resource.
read_onlybooleanIf the connection is read only.
securable_typestringThe type of Unity Catalog securable. (CATALOG, CLEAN_ROOM, CONNECTION, CREDENTIAL, EXTERNAL_LOCATION, EXTERNAL_METADATA, FUNCTION, METASTORE, PIPELINE, PROVIDER, RECIPIENT, SCHEMA, SHARE, STAGING_TABLE, STORAGE_CREDENTIAL, TABLE, VOLUME)
updated_atintegerTime at which this connection was updated, in epoch milliseconds.
updated_bystringUsername of user who last modified connection.
urlstringURL of the remote data source, extracted from options.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectname, deployment_nameGets a connection from it's name.
listselectdeployment_namemax_results, page_tokenList all connections.
createinsertdeployment_name, name, connection_type, optionsCreates a new connection
updateupdatename, deployment_name, optionsUpdates the connection that matches the supplied name.
deletedeletename, deployment_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)
namestringThe name of the connection to be deleted.
max_resultsintegerMaximum number of connections to return. - If not set, all connections are returned (not recommended). - when set to a value greater than 0, the page length is the minimum of this value and a server configured value; - when set to 0, the page length is set to a server configured value (recommended); - when set to a value less than 0, an invalid parameter error is returned;
page_tokenstringOpaque pagination token to go to next page based on previous query.

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_type,
updated_at,
updated_by,
url
FROM databricks_workspace.catalog.connections
WHERE name = '{{ name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;

INSERT examples

Creates a new connection

INSERT INTO databricks_workspace.catalog.connections (
name,
connection_type,
options,
comment,
properties,
read_only,
deployment_name
)
SELECT
'{{ name }}' /* required */,
'{{ connection_type }}' /* required */,
'{{ options }}' /* required */,
'{{ comment }}',
'{{ properties }}',
{{ read_only }},
'{{ 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_type,
updated_at,
updated_by,
url
;

UPDATE examples

Updates the connection that matches the supplied name.

UPDATE databricks_workspace.catalog.connections
SET
options = '{{ options }}',
new_name = '{{ new_name }}',
owner = '{{ owner }}'
WHERE
name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND options = '{{ options }}' --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_type,
updated_at,
updated_by,
url;

DELETE examples

Deletes the connection that matches the supplied name.

DELETE FROM databricks_workspace.catalog.connections
WHERE name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;