Skip to content

prune should have a --dry-run option #70

Description

@AnupamKumar-1

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions