Skip to main content

postgres_projects

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

Overview

Namepostgres_projects
TypeResource
Iddatabricks_workspace.postgres.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)
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
updateupdatename, update_mask, deployment_name, projectUpdates the specified database 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
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
namestringOutput only. The full resource path of the project. Format: projects/{project_id}
project_idstringThe ID to use for the Project. This becomes the final component of the project'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, my-app becomes projects/my-app.
update_maskobjectThe list of fields to update. If unspecified, all fields will be updated when possible.
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 projects in the workspace that the user has permission to access.

SELECT
name,
create_time,
spec,
status,
uid,
update_time
FROM databricks_workspace.postgres.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.postgres_projects (
project,
project_id,
deployment_name
)
SELECT
'{{ project }}' /* required */,
'{{ project_id }}',
'{{ deployment_name }}'
;

UPDATE examples

Updates the specified database project.

UPDATE databricks_workspace.postgres.postgres_projects
SET
project = '{{ project }}'
WHERE
name = '{{ name }}' --required
AND update_mask = '{{ update_mask }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND project = '{{ project }}' --required;