EddytorDocs & API
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.csv

The 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:

  1. query_rows with the filter, selecting just the PK column(s):
    { "table": "…", "columns": ["product_id"], "filter": "status = 'discontinued'" }
  2. Feed those keys to delete_rows (or a merge_rows batch of DELETE operations).

merge_rows with _operation: "DELETE" rows is the alternative when you're already building a mixed insert/update/delete batch.

Heads up

Deletes are real writes recorded as a Delta version - you can roll back a mistaken delete (until vacuum prunes the old files). Still, validate your key list before running a large delete.

Next

On this page