execute_ddl
Run one DDL statement such as CREATE, ALTER, DROP, or TRUNCATE. Row-only or large-change statements are rolled back; returns up to 1,000 rows and times out after 30s.
Instructions
Runs one DDL statement, such as CREATE, ALTER or DROP, or a TRUNCATE. Rolls back a statement that only works on rows, which needs execute_sql, and one that changes more than 100 rows in tables that existed before it. Returns at most 1,000 rows. Times out after 30s.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | One SQL statement, sent to Postgres unchanged. More than one statement is refused. | |
| database | Yes | The database to run on. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | The result rows, each an array in column order. | |
| columns | Yes | The result columns, in order. | |
| rowsAffected | Yes | The number of rows changed. |