vw_branches
Creates, updates, deletes, gets or lists a vw_branches resource.
Overview
| Name | vw_branches |
| Type | View |
| Id | databricks_workspace.postgres.vw_branches |
Fields
The following fields are returned by this view:
| Name | Datatype | Description |
|---|---|---|
name | string | The branch identifier (last component of the resource path). |
create_time | string | Timestamp when the branch was created. |
project_id | string | The project identifier that owns this branch. |
spec | object | Branch specification including expiry and protection settings. |
branch_id | string | System-assigned branch identifier. |
current_state | string | Current operational state of the branch (e.g. READY, INIT). |
default | boolean | Whether this is the project's default branch. |
is_protected | boolean | Whether the branch is protected from deletion and reset. |
logical_size_bytes | integer | Logical size of the branch in bytes. |
state_change_time | string | Timestamp indicating when the current_state began. |
uid | string | System-generated unique ID for the branch. |
update_time | string | Timestamp when the branch 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. |
deployment_name | string | The Databricks workspace deployment name. |
SELECT Examples
SELECT
name,
create_time,
project_id,
spec,
branch_id,
current_state,
default,
is_protected,
logical_size_bytes,
state_change_time,
uid,
update_time
FROM databricks_workspace.postgres.vw_branches
WHERE project_id = '{{ project_id }}'
AND deployment_name = '{{ deployment_name }}';
SQL Definition
- Sqlite3
- Postgres
SELECT
SPLIT_PART(name, '/', -1) AS name,
create_time,
project_id,
spec,
JSON_EXTRACT(status, '$.branch_id') AS branch_id,
JSON_EXTRACT(status, '$.current_state') AS current_state,
JSON_EXTRACT(status, '$.default') AS default,
JSON_EXTRACT(status, '$.is_protected') AS is_protected,
JSON_EXTRACT(status, '$.logical_size_bytes') AS logical_size_bytes,
JSON_EXTRACT(status, '$.state_change_time') AS state_change_time,
uid,
update_time
FROM databricks_workspace.postgres.branches
WHERE project_id = '{{ project_id }}'
AND deployment_name = '{{ deployment_name }}'
SELECT
SPLIT_PART(name, '/', -1) AS name,
create_time,
project_id,
spec,
(status::jsonb)->>'branch_id' AS branch_id,
(status::jsonb)->>'current_state' AS current_state,
(status::jsonb)->>'default' AS default,
(status::jsonb)->>'is_protected' AS is_protected,
(status::jsonb)->>'logical_size_bytes' AS logical_size_bytes,
(status::jsonb)->>'state_change_time' AS state_change_time,
uid,
update_time
FROM databricks_workspace.postgres.branches
WHERE project_id = '{{ project_id }}'
AND deployment_name = '{{ deployment_name }}'