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

Transactional API support #22

Open
WojciechMazur opened this issue May 6, 2020 · 0 comments
Open

Transactional API support #22

WojciechMazur opened this issue May 6, 2020 · 0 comments
Assignees

Comments

@WojciechMazur
Copy link
Collaborator

It should be possible to perform transactional operations using Mutatus which Datastore support.
The most comprehensive solution should allow to use existing syntax (also to not break backward compability)
In case if all operations within transaction block would pass, transaction should be automatically commited, in other case whole transaction would be rolled back
Solution may have syntax as follows

 Dao.transaction{ implicit tx =>  for{
       foo <- Dao.all.filter(_.bar == "bar").run() //since run returns Result[T]
       bar  <- foo.map(_.copy(bar = "foo")).saveAll
      } yield bar
    }

Also additional Batch API (Write only) may be designed as it may use same pattern.

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

No branches or pull requests

1 participant