Workbooks

Swap workbook data sources

Swap the data sources used by a workbook. You can swap from one connection to another, and/or from one dataset or table to another.

Usage notes

  • Retrieve the workbookId by calling the /v2/workbooks endpoint.

  • Retrieve the connectionId by calling the /v2/connections endpoint.

  • Retrieve the sources used by a workbook from the v2/workbooks/{workbookId}/sources endpoint.

  • To swap warehouse tables in a connection, set the swapTables option to true.

    • Use the paths option to specify the connection paths to swap. The connection path is a list of strings that represents the path to the table in the cloud data warehouse. For example, ["database", "schema", "table"].
    • If the table schema is the same in both connections, leave the paths option empty to swap all warehouse tables in the connection. You can also pass a partial path to swap between databases, catalogs, or schemas.
    • If sourceMapping is provided, those mappings take precedence over the connection swaps.
    • If swapTables is not set to true, warehouse tables stay on the original connection. Custom SQL elements and input tables still follow the connection mapping.

Usage scenarios

  • Workbook development: Use a test data source while developing a workbook, then swap the source to a production database when ready to share the workbook for production use.
post/v2/workbooks/{workbookId}/swapSources

Request

  • Base URL
    https://api.sigmacomputing.com
  • Auth
    HTTP bearer

Path parameters

workbookIdstring required

Unique identifier of the workbook.

Request body

copyInputTableDataboolean

Response

The response body.

unswappedSourcesstring[] required

IDs of sources in the workbook that were not swapped.

unswappedConnectionsstring[] required

IDs of custom SQL connections in the workbook that were not swapped.

Changes

No recorded changes to this operation across all 1 revision of this API.