Skip to main content
Check SQL syntax and retrieve the ClickHouse execution plan without running the query. Tremor rewrites namespaces (for example polymarket.events to polymarket_events) before validation, so the explain output matches the actual execution environment.
Validation requests are capped at 60 per minute per authenticated user or API key.

Response fields

  • valid: Indicates whether the statement can execute successfully
  • error: Contains the validation failure message if valid is false
  • explain: Raw ClickHouse EXPLAIN output you can surface in tooling
  • estimated_rows: Reserved for future row-count estimation

Example Response

{
  "valid": true,
  "error": null,
  "estimated_rows": null,
  "explain": "Expression ((Projection + Before ORDER BY))\n  Sorting (Sorting for ORDER BY)\n    Expression (Before ORDER BY)\n      ReadFromMergeTree (polymarket_events)"
}

Usage tips

  • Call this endpoint from editors or CI pipelines before submitting expensive jobs.
  • Use together with POST /api/query to show plan previews in your application.
  • Handle valid=false responses the same way you would handle a 400 error from the execution endpoint.