Skip to main content

synced_database_tables

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

Overview

Namesynced_database_tables
TypeResource
Iddatabricks_workspace.database.synced_database_tables

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringFull three-part (catalog, schema, table) name of the table.
database_instance_namestringName of the target database instance. This is required when creating synced database tables in standard catalogs. This is optional when creating synced database tables in registered catalogs. If this field is specified when creating synced database tables in registered catalogs, the database instance name MUST match that of the registered catalog (or the request will be rejected).
effective_database_instance_namestringThe name of the database instance that this table is registered to. This field is always returned, and for tables inside database catalogs is inferred database instance associated with the catalog. This is an output only field that contains the value computed from the input field combined with server side defaults. Use the field without the effective_ prefix to set the value.
effective_logical_database_namestringThe name of the logical database that this table is registered to. This is an output only field that contains the value computed from the input field combined with server side defaults. Use the field without the effective_ prefix to set the value.
logical_database_namestringTarget Postgres database object (logical database) name for this table. When creating a synced table in a registered Postgres catalog, the target Postgres database name is inferred to be that of the registered catalog. If this field is specified in this scenario, the Postgres database name MUST match that of the registered catalog (or the request will be rejected). When creating a synced table in a standard catalog, this field is required. In this scenario, specifying this field will allow targeting an arbitrary postgres database. Note that this has implications for the `create_database_objects_is_missing` field in `spec`.
data_synchronization_statusobjectSynced Table data synchronization status
specobjectSpecification of a synced database table.
unity_catalog_provisioning_statestringThe provisioning state of the synced table entity in Unity Catalog. This is distinct from the state of the data synchronization pipeline (i.e. the table may be in "ACTIVE" but the pipeline may be in "PROVISIONING" as it runs asynchronously). (ACTIVE, DEGRADED, DELETING, FAILED, PROVISIONING, UPDATING)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectname, deployment_nameGet a Synced Database Table.
listselectinstance_name, deployment_namepage_size, page_tokenThis API is currently unimplemented, but exposed for Terraform support.
createinsertdeployment_name, synced_tableCreate a Synced Database Table.
updateupdatename, update_mask, deployment_name, synced_tableThis API is currently unimplemented, but exposed for Terraform support.
deletedeletename, deployment_namepurge_dataDelete a Synced Database Table.

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)
instance_namestringName of the instance to get synced tables for.
namestring:param purge_data: bool (optional) Optional. When set to true, the actual PostgreSQL table will be dropped from the database.
update_maskstringThe list of fields to update. Setting this field is not yet supported.
page_sizeintegerUpper bound for items returned.
page_tokenstringPagination token to go to the next page of synced database tables. Requests first page if absent.
purge_databoolean

SELECT examples

Get a Synced Database Table.

SELECT
name,
database_instance_name,
effective_database_instance_name,
effective_logical_database_name,
logical_database_name,
data_synchronization_status,
spec,
unity_catalog_provisioning_state
FROM databricks_workspace.database.synced_database_tables
WHERE name = '{{ name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;

INSERT examples

Create a Synced Database Table.

INSERT INTO databricks_workspace.database.synced_database_tables (
synced_table,
deployment_name
)
SELECT
'{{ synced_table }}' /* required */,
'{{ deployment_name }}'
RETURNING
name,
database_instance_name,
effective_database_instance_name,
effective_logical_database_name,
logical_database_name,
data_synchronization_status,
spec,
unity_catalog_provisioning_state
;

UPDATE examples

This API is currently unimplemented, but exposed for Terraform support.

UPDATE databricks_workspace.database.synced_database_tables
SET
synced_table = '{{ synced_table }}'
WHERE
name = '{{ name }}' --required
AND update_mask = '{{ update_mask }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND synced_table = '{{ synced_table }}' --required
RETURNING
name,
database_instance_name,
effective_database_instance_name,
effective_logical_database_name,
logical_database_name,
data_synchronization_status,
spec,
unity_catalog_provisioning_state;

DELETE examples

Delete a Synced Database Table.

DELETE FROM databricks_workspace.database.synced_database_tables
WHERE name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND purge_data = '{{ purge_data }}'
;