vw_roles
Creates, updates, deletes, gets or lists a vw_roles resource.
Overview
| Name | vw_roles |
| Type | View |
| Id | databricks_workspace.postgres.vw_roles |
Fields
The following fields are returned by this view:
| Name | Datatype | Description |
|---|---|---|
name | string | The role identifier (last component of the resource path). |
create_time | string | Timestamp when the role was created. |
project_id | string | The project identifier that owns this role. |
branch_id | string | The branch identifier that owns this role. |
spec | object | Role specification including identity type, auth method, and attributes. |
bypassrls | boolean | Whether the role has the BYPASSRLS attribute. |
createdb | boolean | Whether the role has the CREATEDB attribute. |
createrole | boolean | Whether the role has the CREATEROLE attribute. |
auth_method | string | Authentication method used when connecting to Postgres. |
identity_type | string | The type of Databricks identity backing this role (USER, SERVICE_PRINCIPAL, GROUP). |
membership_roles | string | Standard roles this role is a member of (e.g. DATABRICKS_SUPERUSER). |
postgres_role | string | The name of the underlying Postgres role. |
update_time | string | Timestamp when the role was last updated. |
Required Parameters
The following parameters are required by this view:
| Name | Datatype | Description |
|---|---|---|
project_id | string | The project identifier to scope the query. |
branch_id | string | The branch identifier to scope the query. |
deployment_name | string | The Databricks workspace deployment name. |
SELECT Examples
SELECT
name,
create_time,
project_id,
branch_id,
spec,
bypassrls,
createdb,
createrole,
auth_method,
identity_type,
membership_roles,
postgres_role,
update_time
FROM databricks_workspace.postgres.vw_roles
WHERE project_id = '{{ project_id }}'
AND branch_id = '{{ branch_id }}'
AND deployment_name = '{{ deployment_name }}';
SQL Definition
- Sqlite3
- Postgres
SELECT
SPLIT_PART(name, '/', -1) AS name,
create_time,
project_id,
branch_id,
spec,
JSON_EXTRACT(status, '$.attributes.bypassrls') AS bypassrls,
JSON_EXTRACT(status, '$.attributes.createdb') AS createdb,
JSON_EXTRACT(status, '$.attributes.createrole') AS createrole,
JSON_EXTRACT(status, '$.auth_method') AS auth_method,
JSON_EXTRACT(status, '$.identity_type') AS identity_type,
JSON_EXTRACT(status, '$.membership_roles') AS membership_roles,
JSON_EXTRACT(status, '$.postgres_role') AS postgres_role,
update_time
FROM databricks_workspace.postgres.roles
WHERE project_id = '{{ project_id }}'
AND branch_id = '{{ branch_id }}'
AND deployment_name = '{{ deployment_name }}'
SELECT
SPLIT_PART(name, '/', -1) AS name,
create_time,
project_id,
branch_id,
spec,
(status::jsonb)#>>'{attributes,bypassrls}' AS bypassrls,
(status::jsonb)#>>'{attributes,createdb}' AS createdb,
(status::jsonb)#>>'{attributes,createrole}' AS createrole,
(status::jsonb)->>'auth_method' AS auth_method,
(status::jsonb)->>'identity_type' AS identity_type,
(status::jsonb)->>'membership_roles' AS membership_roles,
(status::jsonb)->>'postgres_role' AS postgres_role,
update_time
FROM databricks_workspace.postgres.roles
WHERE project_id = '{{ project_id }}'
AND branch_id = '{{ branch_id }}'
AND deployment_name = '{{ deployment_name }}'