run_query
Execute read-only SELECT or WITH ... SELECT queries against PostgreSQL databases, returning compact capped rows while rejecting any write or DDL statements before they reach the database.
Instructions
Run a read-only SQL query (SELECT, or WITH ... SELECT) against the database and return compact rows. Results are capped by PG_MAX_ROW_LIMIT. Any INSERT/UPDATE/DELETE/DDL/etc. is rejected before it reaches the database - this server is read-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | Which configured database environment to use. Only "default" is configured, so this can be omitted. | |
| sql | Yes | A single SELECT (or WITH ... SELECT) statement, e.g. "SELECT * FROM orders WHERE status = 'open'" | |
| limit | No | Max rows to return |