Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewing entities at a version, without reverting in the database #16

Open
sneako opened this issue May 21, 2019 · 1 comment
Open

Viewing entities at a version, without reverting in the database #16

sneako opened this issue May 21, 2019 · 1 comment

Comments

@sneako
Copy link

sneako commented May 21, 2019

Hi and thanks for the useful library!

I would like to allow my users to preview the entity before a specific version. It seems that currently one would have to use the revert/2 function on the Repo, but this would actually rollback the changes in the database as well.

Would you be open to accepting a PR that essentially breaks Queryable.revert/3 in half, extracting the first half in to a function like entity_at_version/3 (happy to discuss better names, maybe preview/3?). This function would simply return the result of Enum.reduce(versions, struct, &_revert/2), which is currently in Queryable.revert/3, without changing anything in the database. We could then expose this function as well, on the Repo.

Thoughts?

@narrowtux
Copy link
Contributor

This information should be available in the history function, but yes, it should also be possible to preview a specific version id.

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

No branches or pull requests

2 participants