delete_rows
Deletes rows from one table that match a WHERE filter and returns affected or returning rows. Rolls back changes exceeding 100 rows to prevent accidental bulk deletes.
Instructions
Deletes the rows of one table that match a where filter. Rolls back a call that changes more than 100 rows, triggers and cascades included. Returns rowsAffected and up to 1,000 returning rows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | The table or view to delete from, by exact name. | |
| where | Yes | Conditions joined by AND that pick the rows to delete. | |
| schema | No | The schema, by exact name. Defaults to public. | |
| database | Yes | The database to run on. | |
| returning | No | Columns to return from each changed row. Omit to return none. |
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. |