Supabase Run SQL
supabase_run_sqlRun SQL on a Supabase project to apply schema changes or migrations manually; live writes require human approval.
Instructions
Run SQL on a Supabase project (live write, needs human approval).
Use when: applying schema or migrations by hand; backend_deploy applies the spec's migrations for you. Destructive statements (DROP, TRUNCATE, ALTER ... DROP, GRANT/REVOKE on auth, DELETE/UPDATE without WHERE) always need approval. Returns: {ok, data} rows/result, or an approval_required refusal.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"ref": "<ref>",
"sql": "<sql>"
},
"name": "supabase_run_sql"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | Supabase project ref (20-char id from supabase_list_projects, e.g. 'abcdefghijklmnopqrst'). | |
| sql | Yes | SQL to execute. Destructive statements (DROP, TRUNCATE, DELETE/UPDATE without WHERE) always need approval. | |
| approval_id | No | Approval id from a previous approval_required refusal; omit on the first call. The human approves out-of-band with `appfactory approve <id>`, then call again with the same arguments and this id. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||