execute_sql
Runs SQL on a selected PostgreSQL connection, enforcing read-only validation for restricted mode and allowing DML/DDL on unrestricted connections.
Instructions
Execute SQL on the chosen connection. Connections in 'restricted' mode only accept read-only SQL (validated, READ ONLY transaction, timeout); 'unrestricted' connections accept any SQL (DML/DDL).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | SQL to run | |
| max_rows | No | Máximo de linhas retornadas (o excedente é truncado) | |
| connection | No | Nome ou alias da conexão (veja list_connections). Se omitido, usa a conexão ativa ou a padrão. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |