Fork me on GitHub
#sql
<
2022-10-12
>
ivana15:10:01

Hello! Just to check - does insert-multi keep the order of results of insertion (the same as it's argument vector of insertions order)? May I rely on it? I hope that yes, but want to check 🙂

seancorfield19:10:39

If it is running in sequential mode -- doing a series of single inserts -- then, yes, definitely. If it is running in batch mode -- doing groups of inserts -- then it will do whatever JDBC does for that case which should also be in order as far as I know.

1
ivana21:10:15

Thanks. Keeping in mind, that

When inserting rows as a sequence of lists of column values, the result is
a sequence of the counts of rows affected (a sequence of 1's), if available.
Yes, that is singularly unhelpful.
then the only case of meaningful results is sequential mode - cause only in this case we can see any valuable results but not (1 1 1 ....) So in batch mode we can also think, that order of results is keeped, it can't be reordered 😁 But thanks for clarification about seq mode!