query
Runs a single SQL statement against a chosen PostgreSQL connection, read-only by default. Use positional parameters and row limits to control results safely.
Instructions
Run a single SQL statement. Read-only by default; writes need the connection policy to allow them. Use params for positional parameters ($1) rather than string interpolation. Rows are capped by min(limit, the connection max_rows): applied_limit is the cap that was used and truncated says rows were dropped. When applied_limit is below the limit you asked for, max_rows cut the result and the answer is incomplete. A separate cap on response size can also cut it; when it does, notes says so and the fix is fewer columns, not fewer rows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum rows to return. | |
| params | No | Positional PostgreSQL parameters ($1, $2, ...). | |
| statement | Yes | A single SQL statement. | |
| connection_id | Yes | Connection id. See list_connections. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |