Execute SQL
Runs SQL against a connection and returns rows plus column metadata. Read-only guarded: only SELECT, WITH (CTE) and EXPLAIN are accepted, one statement at a time; write/DDL/admin verbs (INSERT, UPDATE, DELETE, DROP, …) are rejected with 403, and invalid SQL with 400. limit defaults to 1000, caps at 10000. Available to API keys with the execute scope. Exceeding the monthly query quota or the rate limit returns 429.
Request
- Base URL: https://saturnsql.com/api
- URL: https://saturnsql.com/api/queries/execute
- Auth: one of:
- HTTP bearer
- HTTP bearer
Query parameters
Database connection ID
Read-only SQL query to execute (SELECT / WITH / EXPLAIN). May contain {{variable}} placeholders, in which case variables must define every one of them.
Maximum rows to return (default: 1000, max: 10000)
Definitions for the {{placeholders}} in sql. Values are type-checked and escaped against these server side.
Variable values by name. An absent name falls back to that variable's default; a name present with an empty string stays empty.
IANA time zone used to resolve relative date defaults (default: UTC)
Request body
Response
Result rows
Changes
No recorded changes to this operation across all 1 revision of this API.