Run SQL
queryExecute SQL statements against a connected database to retrieve data, inspect schemas, or return affected-row counts. Supports bound parameters and row caps for controlled results.
Instructions
Run a SQL statement. SELECT/SHOW/EXPLAIN return rows (capped by maxRows, default 1000); INSERT/UPDATE/DELETE return affected-row counts; multi-statement scripts are supported where the driver allows them. Params bind with ? (array) or :name (object) where supported.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | SQL statement or script to run | |
| params | No | Bound parameters: array for positional placeholders (?), object for named ones (:name) where the driver supports them. | |
| maxRows | No | Row cap for this query only (server default: 1000) | |
| connection | No | Named connection to use. Omit when only one connection is configured (or it is named "default"). |