Reputation: 6611
Slick has DBIO.seq
and DBIO.sequence
for running many DBIOAction
s whereby the results of previous actions aren't required for subsequent actions.
I've looked at the source, and it's not obvious to me if DBIO.seq
runs the actions sequentially. On the other hand, DBIO.fold
has a very simple implementation which definitely does run the actions sequentially, as it just uses flatMap
internally.
My question is: will order be guaranteed when using seq
and sequence
, like it is with fold
?
Upvotes: 1
Views: 1466
Reputation: 3206
The documentation states that the actions in DBIO.seq
are run sequentially:
The simplest combinator is DBIO.seq which takes a varargs list of actions to run in sequence
Also, in the source code for DBIO.seq
, you will see that SynchronousDatabaseAction
is called inside foreach
, which means that each are sequantially and (internally) synchronously called without any parallel run.
Upvotes: 4