Skip to main content

postgres_branches

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

Overview

Namepostgres_branches
TypeResource
Iddatabricks_workspace.postgres.postgres_branches

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringOutput only. The full resource path of the branch. Format: projects/{project_id}/branches/{branch_id}
create_timestring (date-time)
parentstringThe 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`.
specobjectThe spec contains the branch configuration.
statusobjectThe current status of a Branch.
uidstringSystem-generated unique ID for the branch.
update_timestring (date-time)A timestamp indicating when the branch was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectparent, deployment_namepage_size, page_tokenReturns a paginated list of database branches in the project.
createinsertparent, branch_id, deployment_name, branchCreates 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.

NameDatatypeDescription
branch_idstringThe 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_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
parentstringThe Project where this Branch will be created. Format: projects/{project_id}
page_sizeintegerUpper bound for items returned. Cannot be negative.
page_tokenstringPage token from a previous response. If not provided, returns the first page.

SELECT examples

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

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