executeQuery
executeQueryRun read-only SQL SELECT, WITH, or EXPLAIN queries to retrieve actual result rows, with safe parameter binding and row limits.
Instructions
Run a read-only SQL SELECT / WITH / EXPLAIN when actual result rows are needed. Use timedQuery for one timed execution or benchmarkQuery for repeated latency measurements. Bind '?'->params, ':name'->namedParams; never mix. E.g. :status -> namedParams={status:'PAID'} — key is the bare name. Sets 'truncated' when the row cap is hit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| limit | No | Row limit (default: the connection's maxRows). | |
| params | No | Values for '?' placeholders, in order. | |
| connection | Yes | Database to run against. Call listConnections for valid names; do not guess. | |
| namedParams | No | Values for ':name' placeholders, keyed by name. | |
| timeoutSeconds | No | Timeout in seconds (default: the connection's queryTimeoutSeconds). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | Rows. | |
| columns | No | Columns. | |
| rowCount | Yes | Row Count. | |
| truncated | Yes | Truncated. | |
| columnTypes | No | Column Types. |