-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Use Multi.run to compose sequential db operations.
For example, we perform 3 different get_by db queries in get_delegation!/5, in lib/liquid_voting/delegations.ex, before a final get_by to find the delegation.
Multi.run could be used here, and any for other similarly sequential db operations. It has many advantages, one of which being that it "saves multiple round trips to the database".
For an example of Multi.run, see create_delegation/1 (the clause that uses emails), also in lib/liquid_voting/delegations.ex.
Metadata
Metadata
Assignees
Labels
No labels