query_sql
Run a single SQL statement in a read-only transaction to inspect data safely. Returns up to 1,000 rows, caps output at 1 MB, and times out after 30 seconds.
Instructions
Runs one SQL statement in a read-only transaction, so it cannot change data. Returns at most 1,000 rows and 1,048,576 bytes. Times out after 30s.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | One SQL statement, sent to Postgres unchanged. More than one statement is refused. | |
| database | Yes | The database to run on. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | The result rows, each an array in column order. | |
| columns | Yes | The result columns, in order. | |
| truncated | Yes | True when the row cap, the byte cap or limit cut off more rows. |