Semantic Layer Sync with Preset

This page details the support for Preset (opens in a new tab) in Semantic Layer Sync.

Configuration

To create a new sync, choose Preset:

Data model is synchronized via Preset API (opens in a new tab) which uses API keys for authentication.

You can generate a new API key in your user settings (opens in a new tab) in Preset to obtain an api_token and an api_secret. You can also copy a workspace_url at any page of your Preset workspace. Note that your use should have the workspace role (opens in a new tab) of Workspace Admin.

Example confguration for Preset:

Python
JavaScript
from cube import config
 
@config('semantic_layer_sync')
def semantic_layer_sync(ctx: dict) -> list[dict]:
  return [
    {
      'type': 'preset',
      'name': "Preset Sync",
      'config': {
        'api_token': '07988f63-c200-499e-97c9-ba137d8918aa',
        'api_secret': 'c19fbab4fd4945899795d32898f2e1165bef8e5ee653499e92f083b3d088aecb',
        'workspace_url': '12345678.us1a.app.preset.io',
        'database': 'Cube Cloud: production-deployment'
      }
    }
  ]