07 · Tables A→ZH · Edit data over time
Delete rows by predicate
Remove rows by primary key with delete_rows - and how to delete everything matching a condition.
delete_rows removes rows by primary key - you supply the keys, the matching
rows go, the table stays. To delete "everything matching a condition", you first
find those keys (Eddytor deletes by key, not by raw predicate).
Delete by key
{ "table": "eddytor.cfg_xxx.<uuid>_products",
"keys": [ { "product_id": "P050" }, { "product_id": "P051" } ] }Only the primary-key columns are needed - other fields are ignored.
eddytor delete rows eddytor sales orders --file ./keys-to-delete.csvThe file holds the key columns (CSV, TSV, JSON, or JSONL). The table itself is kept.
Delete by condition (predicate)
Since deletes are key-based, delete-where-X is a two-step:
query_rowswith the filter, selecting just the PK column(s):{ "table": "…", "columns": ["product_id"], "filter": "status = 'discontinued'" }- Feed those keys to
delete_rows(or amerge_rowsbatch ofDELETEoperations).
merge_rows with _operation: "DELETE" rows is the alternative when you're
already building a mixed insert/update/delete batch.
Heads up