Skip to content
This repository has been archived by the owner on May 12, 2024. It is now read-only.

Support transaction rollback of ent commits #63

Open
chipsenkbeil opened this issue Apr 4, 2021 · 0 comments
Open

Support transaction rollback of ent commits #63

chipsenkbeil opened this issue Apr 4, 2021 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@chipsenkbeil
Copy link
Owner

Provide some API to facilitate transactions where all commits succeed or none do, rather than a mixture.

First thought is that we'd provide some wrapper like

db.transaction(|inner_db| {
  // Use inner_db here, which is a wrapper around a database that records the id of every ent committed along with the previous state of the ent to reset
});

In the case of using a global database, something similar can be applied

global::transaction(|db| {
  // db is just a facade around the usage of global::with_db which has also set the database to the wrapper globally and will swap back to non-wrapped version after?
});
@chipsenkbeil chipsenkbeil added the enhancement New feature or request label Apr 4, 2021
@chipsenkbeil chipsenkbeil added this to the Backlog milestone Apr 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant