Cloady Docs
API ReferenceEndpointsApplications

Explain a statement's plan

Plans a statement from streamEngineStatements without running it: EXPLAIN (GENERIC_PLAN) in a read-only transaction on Postgres 16 and later, EXPLAIN FORMAT=JSON on the digest's sample text on MySQL. Flags a sequential scan with a filter on a table of 10,000 rows or more and suggests an index built from the plan's columns.

POST
/api/workspaces/{workspaceSlug}/apps/{appSlug}/services/{serviceName}/engine/plan
AuthorizationBearer <token>

Personal API token (cldy_…)

In: header

Path Parameters

workspaceSlug*string
appSlug*string
serviceName*string

Query Parameters

env?string

Value in

  • "production"
  • "preview"
  • "development"
region?string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/workspaces/string/apps/string/services/string/engine/plan" \  -H "Content-Type: application/json" \  -d '{    "statement": "string"  }'
{  "lines": [    {      "depth": 0,      "text": "string",      "detail": "string",      "flagged": true    }  ],  "relations": [    "string"  ],  "hint": {    "title": "string",    "detail": "string",    "sql": "string"  },  "note": "string"}