run_readonly_query
Execute read-only SQL queries like SELECT, EXPLAIN, and SHOW on PostgreSQL, with automatic validation to block any write or DDL operations.
Instructions
Execute a single read-only SQL query (SELECT / EXPLAIN-without-ANALYZE / SHOW). The query is validated with a real PostgreSQL parser and rejected if it contains any write, DDL, data-modifying CTE, multiple statements, or other side effect. Results are capped at the server row maximum. Returns columns, rows, row count, execution time, and a truncation flag.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The read-only SQL query to execute. | |
| limit | No | Maximum rows to return. Capped at the server row maximum. |