execute_sql
Execute a single SQL statement for PostgreSQL or MySQL databases with positional parameters. Use placeholders $1, $2 for PostgreSQL and ? for MySQL.
Instructions
Execute one PostgreSQL or MySQL SQL statement with optional positional parameters. Generate normal SQL, not MongoDB syntax. Use params instead of interpolating values into sql. For PostgreSQL placeholders use $1, $2, ...; for MySQL placeholders use ?. In --readOnly mode, write/transaction/unknown SQL is rejected.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | Single SQL statement for PostgreSQL or MySQL. PostgreSQL uses $1, $2 placeholders; MySQL uses ? placeholders. | |
| params | No | Values for positional placeholders. Use this instead of string-concatenating user values into SQL. | |
| connectionId | No | Connection id. Defaults to the latest connection. |