#Upsert question

2 messages · Page 1 of 1 (latest)

cedar charm
#

Hi,
Why does Prisma's upsert method has separate create and update objects ?
From my past experience, all libs I've used only needed one for both and I never needed separate values.
So, I'm tempted to make a wrapper kind of like this :

const upsertModel = (model, where, data) => model.upsert({ where, create: data, update: data }));
```What am I missing ?
Thanks
tawny belfryBOT
#

You decided to hold for human wisdom. We'll chime in soon! Meanwhile, #ask-ai is there if you need a quick second opinion.