You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Use
Multi.run
to compose sequential db operations.For example, we perform 3 different
get_by
db queries inget_delegation!/5
, inlib/liquid_voting/delegations.ex
, before a finalget_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
, seecreate_delegation/1
(the clause that uses emails), also inlib/liquid_voting/delegations.ex
.The text was updated successfully, but these errors were encountered: