connections
Operations on a connections
resource.
Overview
Name | connections |
Type | Resource |
Id | databricks_workspace.unitycatalog.connections |
Fields
Name | Datatype |
---|---|
name | string |
comment | string |
connection_id | string |
connection_type | string |
created_at | integer |
created_by | string |
credential_type | string |
full_name | string |
metastore_id | string |
options | object |
owner | string |
properties | object |
provisioning_info | object |
read_only | boolean |
securable_kind | string |
securable_type | string |
updated_at | integer |
updated_by | string |
url | string |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | name, deployment_name | Gets a connection from it's name. |
list | SELECT | deployment_name | List all connections. |
create | INSERT | deployment_name | Creates a new connection |
delete | DELETE | name, deployment_name | Deletes the connection that matches the supplied name. |
update | UPDATE | name, deployment_name | Updates the connection that matches the supplied name. |
SELECT
examples
- connections (list)
- connections (get)
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 }}';
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 name = '{{ name }}' AND
deployment_name = '{{ deployment_name }}';
INSERT
example
Use the following StackQL query and manifest file to create a new connections
resource.
- connections
- Manifest
/*+ 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 }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: connection_type
value: MYSQL
- name: options
value:
property1: string
property2: string
- name: read_only
value: true
- name: comment
value: string
- name: properties
value:
property1: string
property2: string
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 }}';