Assign table modes and filters to source database tables

Requires the Advanced API. The Advanced API requires an Enterprise license.

Each table is assigned a table mode, which determines at a high level how the table is populated in the destination database. Some data connectors also support table filters, which use a WHERE clause to restrict the table records to include.

You can use the API to set table modes and table filters.

Getting the current table modes and filters for a workspace

To get the current assigned table modes and table filters for a workspace, use:

GET /api/Workspace/{workspaceId}/tablemodes

The response contains the list of tables. For each table, the list includes the assigned table mode and, if applicable, the table filter.

Setting table modes and filters for a workspace

To set the assigned table modes and table filters for a workspace, use:

POST /api/Workspace/{workspaceId}/tablemodes

The request provides the list of tables. For each table, the list includes the table mode to assign and, if applicable, the table filter.

For example:

{
  "schema": "public",
  "table": "transactions",
  "tableMode": "Masked",
  "filterClause": "date > '2022-05-02'"
}

The available values for tableMode are:

  • Masked - Indicates to use De-Identify table mode. This is the default table mode.

  • Synthesized - Indicates to use Scale table mode. Note that for Scale mode, you can specify a number of rows to generate. The default is 100. You cannot use the API to set the number of rows. You must use the Tonic Structural application.

  • Truncated - Indicates to use Truncate table mode.

  • PreserveDestination - Indicates to use Preserve Destination table mode.

  • Incremental - Indicates to use Incremental table mode. Note that for Incremental mode to work, you must specify a date updated column to use. You cannot use the API to select the column. You must use the Structural application.

Setting the same table mode for multiple tables

To assign the same table mode to a set of tables, you can use:

POST /api/Workspace/{workspaceId}/bulk_table_mode

The request provides a list of tables to update, and the table mode (tableModeEnum) to assign to those tables.

For example:

{
  "tables": [
    {
      "schema": "public",
      "table": "customers_legacy"
    },
    {
      "schema": "public",
      "table": "legacy_wo"
    }
  ],
  "tableModeEnum": "Truncated"
}

The available values for tableModeEnum are:

  • Masked - Indicates to use De-Identify table mode. This is the default table mode.

  • Synthesized - Indicates to use Scale table mode. Note that for Scale mode, you can specify a number of rows to generate. The default is 100. You cannot use the API to set the number of rows. You must use the Tonic Structural application.

  • Truncated - Indicates to use Truncate table mode.

  • PreserveDestination - Indicates to use Preserve Destination table mode.

  • Incremental - Indicates to use Incremental table mode. Note that for Incremental mode to work, you must specify a date updated column to use. You cannot use the API to select the column. You must use the Structural application.

Last updated