Run SQL on a database
run_sqlRun SQL on a Postgres database. Read-only unless writes is true (then it can change or drop data: show the person the statement and get their go-ahead first; writes are recorded in the account's audit log). One statement result, the first 500 rows, 30 seconds at most. A statement Postgres refuses comes back with ok: false and its error. Use get_database_schema to see the tables first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The database's service id, from list_services | |
| sql | Yes | The SQL to run | |
| writes | No | Allow changes (INSERT, UPDATE, DDL). Off by default: a read-only transaction. |