connections
Creates, updates, deletes, gets or lists a connections resource.
Overview
| Name | connections |
| Type | Resource |
| Id | databricks_workspace.catalog.connections |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the connection. |
connection_id | string | Unique identifier of the Connection. |
metastore_id | string | Unique identifier of parent metastore. |
full_name | string | Full name of connection. |
comment | string | User-provided free-form text description. |
connection_type | string | The 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_at | integer | Time at which this connection was created, in epoch milliseconds. |
created_by | string | Username of connection creator. |
credential_type | string | The 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) |
options | object | A map of key-value properties attached to the securable. |
owner | string | Username of current owner of the connection. |
properties | object | A map of key-value properties attached to the securable. |
provisioning_info | object | Status of an asynchronously provisioned resource. |
read_only | boolean | If the connection is read only. |
securable_type | string | The 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_at | integer | Time at which this connection was updated, in epoch milliseconds. |
updated_by | string | Username of user who last modified connection. |
url | string | URL of the remote data source, extracted from options. |
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the connection. |
connection_id | string | Unique identifier of the Connection. |
metastore_id | string | Unique identifier of parent metastore. |
full_name | string | Full name of connection. |
comment | string | User-provided free-form text description. |
connection_type | string | The 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_at | integer | Time at which this connection was created, in epoch milliseconds. |
created_by | string | Username of connection creator. |
credential_type | string | The 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) |
options | object | A map of key-value properties attached to the securable. |
owner | string | Username of current owner of the connection. |
properties | object | A map of key-value properties attached to the securable. |
provisioning_info | object | Status of an asynchronously provisioned resource. |
read_only | boolean | If the connection is read only. |
securable_type | string | The 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_at | integer | Time at which this connection was updated, in epoch milliseconds. |
updated_by | string | Username of user who last modified connection. |
url | string | URL of the remote data source, extracted from options. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | name, deployment_name | Gets a connection from it's name. | |
list | select | deployment_name | max_results, page_token | List all connections. |
create | insert | deployment_name, name, connection_type, options | Creates a new connection | |
update | update | name, deployment_name, options | Updates the connection that matches the supplied name. | |
delete | delete | name, deployment_name | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
name | string | The name of the connection to be deleted. |
max_results | integer | Maximum 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_token | string | Opaque pagination token to go to next page based on previous query. |
SELECT examples
- get
- list
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
;
List all connections.
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 deployment_name = '{{ deployment_name }}' -- required
AND max_results = '{{ max_results }}'
AND page_token = '{{ page_token }}'
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: connections
props:
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the connections resource.
- name: name
value: "{{ name }}"
description: |
Name of the connection.
- name: connection_type
value: "{{ connection_type }}"
description: |
The type of connection.
- name: options
value: "{{ options }}"
description: |
A map of key-value properties attached to the securable.
- name: comment
value: "{{ comment }}"
description: |
User-provided free-form text description.
- name: properties
value: "{{ properties }}"
description: |
A map of key-value properties attached to the securable.
- name: read_only
value: {{ read_only }}
description: |
If the connection is read only.
UPDATE examples
- update
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
- delete
Deletes the connection that matches the supplied name.
DELETE FROM databricks_workspace.catalog.connections
WHERE name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;