# The SyncedTable object

## Attributes

- `name` (string)
  Output only. The Full resource name of the synced table in Postgres
   where (catalog, schema, table) are the UC entity names.
  
   Format "synced_tables/{catalog}.{schema}.{table}"
  
   For the corresponding source table in the Unity catalog look for the "source_table_full_name" attribute.
- `uid` (string)
  The Unity Catalog table ID for this synced table.
- `spec` (object)
  Configuration details of the synced table, such as the source table, scheduling policy, etc.
   This attribute is specified at creation time and most fields are returned as is on subsequent queries.
  - `postgres_database` (string)
    The Postgres database name where the synced table will be created in.
    
     If this synced table is created inside a Lakebase Catalog, this attribute can be omitted on creation and is inferred
     from the postgres_database associated with the Lakebase Catalog. If specified when inside a Lakebase Catalog, the value must match.
    
     A value must be specified when creating a synced table inside a Standard Catalog.
  - `branch` (string)
    The full resource name the branch associated with the table.
    
     Format: "projects/{project_id}/branches/{branch_id}".
  - `scheduling_policy` (string)
    Scheduling policy of the underlying pipeline.
    Possible values: `SYNCED_TABLE_SCHEDULING_POLICY_UNSPECIFIED`, `CONTINUOUS`, `TRIGGERED`, `SNAPSHOT`
  - `source_table_full_name` (string)
    Three-part (catalog, schema, table) name of the source Delta table.
    
     For the corresponding destination table, use any of the two:
    
     * synced_table_id used at the creation of the SyncedTable
     * "name" consisting of "synced_tables/" prefix and the full name of the destination table.
  - `primary_key_columns` (array of string)
    Primary Key columns to be used for data insert/update in the destination.
  - `timeseries_key` (string)
    Time series key to deduplicate (tie-break) rows with the same primary key.
  - `existing_pipeline_id` (string)
    ID of an existing pipeline to bin-pack this synced table into.
     At most one of existing_pipeline_id and new_pipeline_spec should be defined.
    
     The pipeline used for the synced table is returned via the top level pipeline_id attribute.
  - `create_database_objects_if_missing` (boolean)
    If true, the synced table's logical database and schema resources in PG
     will be created if they do not already exist.
     The request will fail if this is false and the database/schema do not exist.
    
     Defaults to true if omitted.
    Default: `true`
  - `new_pipeline_spec` (object)
    Specification for creating a new pipeline.
     At most one of existing_pipeline_id and new_pipeline_spec should be defined.
    
     The pipeline used for the synced table is returned via the top level pipeline_id attribute.
    - `storage_catalog` (string)
      UC catalog for the pipeline to store intermediate files (checkpoints, event logs etc).
       This needs to be a standard catalog where the user has permissions to create Delta tables.
    - `storage_schema` (string)
      UC schema for the pipeline to store intermediate files (checkpoints, event logs etc).
       This needs to be in the standard catalog where the user has permissions to create Delta tables.
    - `budget_policy_id` (string)
      Budget policy to set on the newly created pipeline.
  - `type_overrides` (array of object)
    Override the default Delta->PG type mapping for specific columns.
     A TypeOverride with PG_SPECIFIC_TYPE_UNSPECIFIED is rejected; a valid pg_type must be set.
    - `column_name` (string)
      Name of the source column whose target PostgreSQL type should be overridden.
    - `pg_type` (string)
      PostgreSQL-specific target type to use for the column.
      Possible values: `PG_SPECIFIC_TYPE_UNSPECIFIED`, `PG_SPECIFIC_TYPE_VECTOR`, `PG_SPECIFIC_TYPE_HALFVEC`, `PG_SPECIFIC_TYPE_VARCHAR`
    - `size` (int32)
      Size parameter for the target type, for types that take one (e.g. vector
       dimension, varchar length). Required when the chosen pg_type needs a size.
- `status` (object)
  Synced Table data synchronization status.
  - `message` (string)
    A text description of the current state of the synced table.
  - `detailed_state` (string)
    The state of the synced table.
    Possible values: `SYNCED_TABLE_STATE_UNSPECIFIED`, `SYNCED_TABLE_PROVISIONING`, `SYNCED_TABLE_PROVISIONING_PIPELINE_RESOURCES`, `SYNCED_TABLE_PROVISIONING_INITIAL_SNAPSHOT`, `SYNCED_TABLE_ONLINE`, `SYNCED_TABLE_ONLINE_CONTINUOUS_UPDATE`, `SYNCED_TABLE_ONLINE_TRIGGERED_UPDATE`, `SYNCED_TABLE_ONLINE_NO_PENDING_UPDATE`, `SYNCED_TABLE_OFFLINE`, `SYNCED_TABLE_OFFLINE_FAILED`, `SYNCED_TABLE_ONLINE_PIPELINE_FAILED`, `SYNCED_TABLE_ONLINE_UPDATING_PIPELINE_RESOURCES`
  - `last_sync` (object)
    Summary of the last successful synchronization from source to destination.
    - `sync_start_time` (string)
      The starting timestamp of the most recent successful synchronization from the source table
       to the destination (synced) table.
       Note this is the starting timestamp of the sync operation, not the end time.
       E.g., for a batch, this is the time when the sync operation started.
    - `sync_end_time` (string)
      The end timestamp of the most recent successful synchronization.
       This is the time when the data is available in the synced table.
    - `delta_table_sync_info` (object)
      - `delta_commit_version` (int64)
        The Delta Lake commit version that was last successfully synced.
      - `delta_commit_time` (string)
        The timestamp when the above Delta version was committed in the source Delta table.
         Note: This is the Delta commit time, not the time the data was written to the synced table.
  - `ongoing_sync_progress` (object)
    - `latest_version_currently_processing` (int64)
      The source table Delta version that was last processed by the pipeline. The pipeline may not
       have completely processed this version yet.
    - `synced_row_count` (int64)
      The number of rows that have been synced in this update.
    - `total_row_count` (int64)
      The total number of rows that need to be synced in this update. This number may be an estimate.
    - `sync_progress_completion` (double)
      The completion ratio of this update. This is a number between 0 and 1.
    - `estimated_completion_time_seconds` (double)
      The estimated time remaining to complete this update in seconds.
  - `provisioning_phase` (string)
    The current phase of the data synchronization pipeline.
    Possible values: `PROVISIONING_PHASE_UNSPECIFIED`, `PROVISIONING_PHASE_MAIN`, `PROVISIONING_PHASE_INDEX_SCAN`, `PROVISIONING_PHASE_INDEX_SORT`
  - `last_processed_commit_version` (int64)
    The last source table Delta version that was successfully synced to the synced table.
  - `last_sync_time` (string)
    The end timestamp of the last time any data was synchronized from the source table to the synced
     table. This is when the data is available in the synced table.
  - `pipeline_id` (string)
    ID of the associated pipeline.
  - `unity_catalog_provisioning_state` (string)
    The provisioning state of the synced table entity in Unity Catalog.
    Possible values: `STATE_UNSPECIFIED`, `PROVISIONING`, `ACTIVE`, `FAILED`, `DELETING`, `UPDATING`, `DEGRADED`
  - `project` (string)
    The full resource name of the project associated with the table.
    
     Format: "projects/{project_id}".
- `create_time` (string)
- `synced_table_id` (string)
  The part of the name, chosen by the user when the resource was created.

## Example

```json
{
  "name": "string",
  "uid": "string",
  "spec": {
    "postgres_database": "string",
    "branch": "string",
    "scheduling_policy": "string",
    "source_table_full_name": "string",
    "primary_key_columns": [
      "string"
    ],
    "timeseries_key": "string",
    "existing_pipeline_id": "string",
    "create_database_objects_if_missing": true,
    "new_pipeline_spec": {},
    "type_overrides": [
      {}
    ]
  },
  "status": {
    "message": "string",
    "detailed_state": "string",
    "last_sync": {},
    "ongoing_sync_progress": {},
    "provisioning_phase": "string",
    "last_processed_commit_version": 0,
    "last_sync_time": "string",
    "pipeline_id": "string",
    "unity_catalog_provisioning_state": "string",
    "project": "string"
  },
  "create_time": "string",
  "synced_table_id": "string"
}
```


