Skip to content

feat: add atomic Store::wipe for local and remote stores - #41

Merged
emma31-dev merged 2 commits into
mainfrom
feat/40-atomic-wipe
Nov 26, 2026
Merged

emma31-dev merged 2 commits into
mainfrom
feat/40-atomic-wipe

Conversation

@emma31-dev

Copy link
Copy Markdown
Owner

Summary

Adds Store::wipe(), which deletes all rows from the tables managed by bdk_turso without dropping the schema or reopening the store.

  • Clears core, wallet, and PSBT tables when they exist; feature-gated tables are discovered from the database so a table created by an earlier build is still wiped.
  • Runs every delete in one Deferred transaction, so a failure before commit leaves the previous data intact.
  • Keeps the schema, indexes, options, and encryption settings usable.
  • Succeeds as a no-op on an unmigrated store and leaves unrelated tables untouched.
  • For remote stores, pulls first, commits locally, then pushes. A failed upload returns Error::RemotePush and can be retried with Store::push().
  • Documents that this is a logical wipe, not a secure erase.

Closes #40.

Tests

  • cargo test
  • cargo test --all-features --lib --test persistence
  • cargo test --no-default-features --lib
  • cargo test --all-features --no-run
  • RUSTDOCFLAGS="-D warnings" cargo doc --all-features --no-deps

Remote coverage is an ignored test that uses BDK_TURSO_REMOTE_URL and BDK_TURSO_AUTH_TOKEN, following the existing sync test pattern.

Clear every table managed by bdk_turso in a single transaction, discovering feature-gated tables from the database so stores created by other builds are wiped too. Wiping an unmigrated store is a no-op, and remote stores pull before clearing and push the deletion afterward.

Document that this is a logical wipe rather than a secure erase.
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@emma31-dev
emma31-dev merged commit fa50f5a into main Nov 26, 2026
10 checks passed
@emma31-dev
emma31-dev deleted the feat/40-atomic-wipe branch November 26, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add an atomic wipe for local and remote stores

1 participant