obyflow prune --older-than 30d currently prints something like:
This will permanently delete events older than <date> from obyflow.db (1234 total event(s) currently stored).
Re-run with --yes to confirm.
That "1234 total" is every event in the DB, not the count matching --older-than. There's no way to know how many rows will actually be deleted before committing, which isn't great for a destructive command in a script.
- Add a
--dry-run flag that computes and prints the actual matching count, then exits without deleting — should short-circuit even if --yes is also passed
- May need a small addition to the store layer (e.g.
countOlderThan(beforeIso)) — check packages/core first for anything reusable
- Add a test for the dry-run path (
prune.ts has no test file at all right now, so this covers both)
obyflow prune --older-than 30dcurrently prints something like:That "1234 total" is every event in the DB, not the count matching
--older-than. There's no way to know how many rows will actually be deleted before committing, which isn't great for a destructive command in a script.--dry-runflag that computes and prints the actual matching count, then exits without deleting — should short-circuit even if--yesis also passedcountOlderThan(beforeIso)) — checkpackages/corefirst for anything reusableprune.tshas no test file at all right now, so this covers both)