is there a limit to the number of elements one can...
# prisma-client
i
is there a limit to the number of elements one can put in a createMany call?
d
Ive not tried it, Im guessing it depends on how large each item is and the amount of memory on the machine
I have pushed the engine to failing but that is for recursive seeding rather than a single createMany
that was 100'000s of items though over recursive selecting of items so a lot of data was in memory
r
@iamtheworstdev đź‘‹ Are you facing any issue while putting a large number of items?
i
actually haven't tried it yet. wrote a lot of data loading code before I found the createMany api. but I expected to see something like 'soft limited to 1000 items' or something in the docs and didn't see it.. thought maybe there was a limit and it was just forgotten about in the docs.. didn't want to play a guessing game of how many was permitted when i get around to rewriting my database seeding
r
I don’t think there is. You could try adding a 1000 records and that should complete easily.
d
just for posterity, I generated an array 1,000,000 items long, filled it with a single key value and it inserted with no issues
i
if I'm reading the docs right.. the updateMany is not an upsert.. it's just a normal update statement ?
because update is artificially limited to 1?
r
Yes
updateMany
is just
update
but for multiple items. Upsert is different, it creates the item if doesn’t exist or updates it if it does.