Skip to main content

projects

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

Overview

Nameprojects
TypeResource
Iddatabricks_workspace.postgres.projects

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringOutput only. The full resource path of the project. Format: projects/{project_id}
create_timestring (date-time)
initial_endpoint_specobjectConfiguration settings for the initial Read/Write endpoint created inside the default branch for a newly created project. If omitted, the initial endpoint created will have default settings, without high availability configured. This field does not apply to any endpoints created after project creation. Use spec.default_endpoint_settings to configure default settings for endpoints created after project creation.
specobjectThe spec contains the project configuration, including display_name, pg_version (Postgres version), history_retention_duration, and default_endpoint_settings.
statusobjectThe current status of a Project.
uidstringSystem-generated unique ID for the project.
update_timestring (date-time)A timestamp indicating when the project was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectdeployment_namepage_size, page_tokenReturns a paginated list of database projects in the workspace that the user has permission to access.
createinsertproject_id, deployment_name, projectCreates a new Lakebase Autoscaling Postgres database project, which contains branches and compute
updateupdateproject_id, branch_id, role_id, update_mask, deployment_name, roleUpdate a role for a branch.

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 unique identifier of the branch. Format: projects/{project_id}/branches/{branch_id}
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
project_idstringThe unique identifier of the Postgres project. Format: projects/{project_id}
role_idstringThe unique identifier of the role to update. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id}
update_maskobjectThe list of fields to update in Postgres Role. If unspecified, all fields will be updated when possible.
page_sizeintegerUpper bound for items returned. Cannot be negative. The maximum value is 100.
page_tokenstringPage token from a previous response. If not provided, returns the first page.

SELECT examples

Returns a paginated list of database projects in the workspace that the user has permission to access.

SELECT
name,
create_time,
initial_endpoint_spec,
spec,
status,
uid,
update_time
FROM databricks_workspace.postgres.projects
WHERE deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;

INSERT examples

Creates a new Lakebase Autoscaling Postgres database project, which contains branches and compute

INSERT INTO databricks_workspace.postgres.projects (
project,
project_id,
deployment_name
)
SELECT
'{{ project }}' /* required */,
'{{ project_id }}',
'{{ deployment_name }}'
;

UPDATE examples

Update a role for a branch.

UPDATE databricks_workspace.postgres.projects
SET
role = '{{ role }}'
WHERE
project_id = '{{ project_id }}' --required
AND branch_id = '{{ branch_id }}' --required
AND role_id = '{{ role_id }}' --required
AND update_mask = '{{ update_mask }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND role = '{{ role }}' --required;