postgres_tables
Creates, updates, deletes, gets or lists a postgres_tables resource.
Overview
| Name | postgres_tables |
| Type | Resource |
| Id | databricks_workspace.postgres.postgres_tables |
Fields
The following fields are returned by SELECT queries:
- get
| Name | Datatype | Description |
|---|---|---|
name | string | Full three-part (catalog, schema, table) name of the table. |
branch | string | The id of the database branch associated with the table. Of the format projects/{project_id}/branches/{branch_id}. |
database | string | The project and branch scoped database to which this table belongs. Of the format: projects/{project_id}/branches/{branch_id}/databases/{database_id} where database_id is the name of the logical database in Postgres. |
project | string | The id of the database project associated with the table. Of the format projects/{project_id}. |
table_serving_url | string | REST API URL for serving data from this table. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | name, deployment_name | Get a Table (non-synced database table for Autoscaling v2 Lakebase projects). | |
create | insert | deployment_name, table | Create a Table (non-synced database table for Autoscaling v2 Lakebase projects). | |
delete | delete | name, deployment_name | Delete a Table (non-synced database table for Autoscaling v2 Lakebase projects). |
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 |
|---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
name | string | Full three-part (catalog, schema, table) name of the table. |
SELECT examples
- get
Get a Table (non-synced database table for Autoscaling v2 Lakebase projects).
SELECT
name,
branch,
database,
project,
table_serving_url
FROM databricks_workspace.postgres.postgres_tables
WHERE name = '{{ name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;
INSERT examples
- create
- Manifest
Create a Table (non-synced database table for Autoscaling v2 Lakebase projects).
INSERT INTO databricks_workspace.postgres.postgres_tables (
table,
deployment_name
)
SELECT
'{{ table }}' /* required */,
'{{ deployment_name }}'
RETURNING
name,
branch,
database,
project,
table_serving_url
;
# Description fields are for documentation purposes
- name: postgres_tables
props:
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the postgres_tables resource.
- name: table
description: |
Table represents a non-synced database table in a Lakebase project. Unlike SyncedTable, this
does not have a data synchronization pipeline.
value:
name: "{{ name }}"
database: "{{ database }}"
branch: "{{ branch }}"
project: "{{ project }}"
table_serving_url: "{{ table_serving_url }}"
DELETE examples
- delete
Delete a Table (non-synced database table for Autoscaling v2 Lakebase projects).
DELETE FROM databricks_workspace.postgres.postgres_tables
WHERE name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;