Run write SQL
execute_sqlRun write SQL (INSERT, UPDATE, DELETE, DDL) against the project's managed PostgreSQL database — the same path as the dashboard DB console's write mode, with the same limits (row/byte caps, per-statement timeout, 25 statements max, one transaction: all commit or all roll back). Executes with the project's own tenant credentials, never an admin connection. Row-producing statements return columns+rows; others return rows_affected. DROP, DELETE, TRUNCATE and ALTER are irreversible. For reads, use query_sql. If the tool reports lost credentials, provision_postgres repairs them. Requires a read-write token.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | the SQL to run against the project's managed PostgreSQL database: write-capable, up to 25 ;-separated statements executed in ONE transaction (all commit or all roll back). DROP, DELETE, TRUNCATE and ALTER are irreversible | |
| project_id | Yes | the project id (from list_projects) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | present, and always "pending_approval", only when this call was parked instead of run immediately because the project's (or kad-back's own) plan-mode setting requires a human to approve it first | |
| message | Yes | ||
| plan_id | No | poll get_plan_status with this id for the eventual outcome | |
| approve_at | No | the kad.dev dashboard URL a human approves or rejects this plan from | |
| project_id | Yes | ||
| statements | Yes | ||
| expires_in_s | No | the plan can no longer be approved after this many seconds |