Run read-only query
run_queryExecute read-only SQL statements (SELECT, WITH, EXPLAIN, SHOW) against the local Postgres database using optional parameters for safe data retrieval.
Instructions
Run a single read-only SQL statement (SELECT/WITH/EXPLAIN/SHOW). Executes inside a READ ONLY transaction. Use $1, $2… placeholders with params.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | A single read-only SQL statement. | |
| limit | No | Max rows to return (default 500). | |
| params | No | Positional parameters for $1, $2, … |