v11

latestOpenAPI 3.1.0raw.githubusercontent.com2026-03-051387180.3 KB
compiler

Execute query with transparent caching

Execute a query with transparent caching.

Compiles the resolved query to SQL, checks the cache for existing results, executes against the warehouse on cache miss, and stores the result for future requests. Cache failures are invisible to the caller.

RLS: Filtered to current client (ClientRLSDB).

post/api/v1/compiler/execute

Query parameters

sourcestring nullable

Headers

X-Kater-CLI-IDstring nullable

Request body

connection_idstring uuid required

Connection to execute against

tenant_keystring required

Tenant key for multi-tenant execution. Use 'kater_global_tenant' for no-tenancy clients.

Example request

{
  "resolved_query": {
    "chart_hints": [
      {
        "config": {
          "color_by": "ref(created_date)",
          "size": "ref(created_date)",
          "stack_by": "ref(created_date)",
          "x_axis": "ref(created_date)",
          "y_axis": "ref(created_date)"
        }
      }
    ],
    "filters": [
      {
        "exists": {
          "from": "ref(dim_customer.sale_price)"
        },
        "not_exists": {
          "from": "ref(dim_customer.sale_price)"
        }
      }
    ],
    "resolved_chart": {
      "config": {
        "color_by": "ref(created_date)",
        "size": "ref(created_date)",
        "stack_by": "ref(created_date)",
        "x_axis": "ref(created_date)",
        "y_axis": "ref(created_date)"
      }
    },
    "resolved_variables": [
      {
        "allowed_values": {
          "from_column": "ref(dim_customer.sale_price)"
        }
      }
    ],
    "select_from": [
      {
        "ref": "ref(dim_customer.sale_price)"
      }
    ],
    "source_query": "ref(dim_customer.sale_price)",
    "topic": "ref(dim_customer.sale_price)"
  }
}

Response

Successful Response

cache_hitboolean

Whether the result was served from cache

dataobject[]

Query result rows as list of column-value dicts

dialectstring required

SQL dialect used

execution_time_msnumber

Total execution time in milliseconds

row_countinteger

Number of rows returned

sqlstring nullable

Generated SQL statement

successboolean required

Whether execution succeeded