Skip to content

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

Open
@sneako

Description

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?

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions