postgres_branches
Creates, updates, deletes, gets or lists a postgres_branches resource.
Overview
| Name | postgres_branches |
| Type | Resource |
| Id | databricks_workspace.postgres.postgres_branches |
Fields
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
name | string | Output only. The full resource path of the branch. Format: projects/{project_id}/branches/{branch_id} |
create_time | string (date-time) | |
parent | string | The project containing this branch (API resource hierarchy). Format: projects/{project_id} Note: This field indicates where the branch exists in the resource hierarchy. For point-in-time branching from another branch, see `status.source_branch`. |
spec | object | The spec contains the branch configuration. |
status | object | The current status of a Branch. |
uid | string | System-generated unique ID for the branch. |
update_time | string (date-time) | A timestamp indicating when the branch was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | parent, deployment_name | page_size, page_token | Returns a paginated list of database branches in the project. |
create | insert | parent, branch_id, deployment_name, branch | Creates a new database branch in the project. |
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 |
|---|---|---|
branch_id | string | The ID to use for the Branch. This becomes the final component of the branch's resource name. The ID is required and must be 1-63 characters long, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens. For example, development becomes projects/my-app/branches/development. |
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
parent | string | The Project where this Branch will be created. Format: projects/{project_id} |
page_size | integer | Upper bound for items returned. Cannot be negative. |
page_token | string | Page token from a previous response. If not provided, returns the first page. |
SELECT examples
- list
Returns a paginated list of database branches in the project.
SELECT
name,
create_time,
parent,
spec,
status,
uid,
update_time
FROM databricks_workspace.postgres.postgres_branches
WHERE parent = '{{ parent }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;
INSERT examples
- create
- Manifest
Creates a new database branch in the project.
INSERT INTO databricks_workspace.postgres.postgres_branches (
branch,
parent,
branch_id,
deployment_name
)
SELECT
'{{ branch }}' /* required */,
'{{ parent }}',
'{{ branch_id }}',
'{{ deployment_name }}'
;
# Description fields are for documentation purposes
- name: postgres_branches
props:
- name: parent
value: "{{ parent }}"
description: Required parameter for the postgres_branches resource.
- name: branch_id
value: "{{ branch_id }}"
description: Required parameter for the postgres_branches resource.
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the postgres_branches resource.
- name: branch
description: |
The Branch to create.
value:
create_time: "{{ create_time }}"
name: "{{ name }}"
parent: "{{ parent }}"
spec:
expire_time: "{{ expire_time }}"
is_protected: {{ is_protected }}
no_expiry: {{ no_expiry }}
source_branch: "{{ source_branch }}"
source_branch_lsn: "{{ source_branch_lsn }}"
source_branch_time: "{{ source_branch_time }}"
ttl: "{{ ttl }}"
status:
current_state: "{{ current_state }}"
default: {{ default }}
expire_time: "{{ expire_time }}"
is_protected: {{ is_protected }}
logical_size_bytes: {{ logical_size_bytes }}
pending_state: "{{ pending_state }}"
source_branch: "{{ source_branch }}"
source_branch_lsn: "{{ source_branch_lsn }}"
source_branch_time: "{{ source_branch_time }}"
state_change_time: "{{ state_change_time }}"
uid: "{{ uid }}"
update_time: "{{ update_time }}"