Mykyta Machekhin
10/05/2021, 9:52 AMMykyta Machekhin
10/05/2021, 9:56 AMRyan
10/05/2021, 10:28 AMMykyta Machekhin
10/05/2021, 10:30 AMMykyta Machekhin
10/05/2021, 2:02 PMRyan
10/05/2021, 2:28 PMRyan
10/05/2021, 2:28 PMcopied
array are unique right?Mykyta Machekhin
10/05/2021, 2:33 PMMykyta Machekhin
10/05/2021, 2:34 PMRyan
10/05/2021, 2:35 PMRyan
10/05/2021, 2:35 PMBut I can try to conduct a test with an array filtered from duplicatesIf the combined key is not unique, then it will throw an error.
Mykyta Machekhin
10/05/2021, 2:43 PM[(1, 1), (2, 2), (1, 1)]
. The first two records will be inserted without problems. When we get to the last entry (1, 1)
, The prisma will transactionally check whether there is already such a record in the database, if not, then insert, if there is, then update (in my example - the update is fictitious, in fact nothing will happen). Of course, all three inserts happen in parallel, but again, thanks to the transactional upsert operation, I expect that uniqueness errors should not occur here in any caseRyan
10/05/2021, 2:46 PMMykyta Machekhin
10/05/2021, 2:49 PM