Skip to main content

vw_roles

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

Overview

Namevw_roles
TypeView
Iddatabricks_workspace.postgres.vw_roles

Fields

The following fields are returned by this view:

NameDatatypeDescription
namestringThe role identifier (last component of the resource path).
create_timestringTimestamp when the role was created.
project_idstringThe project identifier that owns this role.
branch_idstringThe branch identifier that owns this role.
specobjectRole specification including identity type, auth method, and attributes.
bypassrlsbooleanWhether the role has the BYPASSRLS attribute.
createdbbooleanWhether the role has the CREATEDB attribute.
createrolebooleanWhether the role has the CREATEROLE attribute.
auth_methodstringAuthentication method used when connecting to Postgres.
identity_typestringThe type of Databricks identity backing this role (USER, SERVICE_PRINCIPAL, GROUP).
membership_rolesstringStandard roles this role is a member of (e.g. DATABRICKS_SUPERUSER).
postgres_rolestringThe name of the underlying Postgres role.
update_timestringTimestamp when the role was last updated.

Required Parameters

The following parameters are required by this view:

NameDatatypeDescription
project_idstringThe project identifier to scope the query.
branch_idstringThe branch identifier to scope the query.
deployment_namestringThe 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

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 }}'