Chris Kihneman
03/29/2022, 8:46 PMupdateMany
really only seems to handle one data change on multiple records. What I really need is something like createMany
, where you can prep lots of updates for many records, then execute them all at once.
I take it the only real option to speed things up is batching inside of a transaction? In sets of like 10 or so?
await prisma.$transaction([
prisma.table.update({ where: { id: id1 }, data: { field: field1 }),
prisma.table.update({ where: { id: id2 }, data: { field: field2 }),
prisma.table.update({ where: { id: id3 }, data: { field: field3 }),
...
])
Austin Zentz
03/30/2022, 1:03 PMAustin Zentz
03/30/2022, 1:03 PMAustin Zentz
03/30/2022, 1:03 PMAustin Zentz
03/30/2022, 1:04 PMAustin Zentz
03/30/2022, 1:05 PMAustin Zentz
03/30/2022, 1:05 PMChris Kihneman
03/30/2022, 10:36 PM