New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple insertOrUpdate (insert ... on duplicate key update) #8134
Comments
Doesn't upsert solve this for you: https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#upsert Upsert basically will insert if |
@pantharshit00 Thank you for your answer. |
Isn't |
The current I currently have to use raw SQL to do upserts to continue using Prisma. But other than that it's such a nice library 🥰 |
Does update: |
The upsert solves this for a single row, but upsert many are still missing and thus, doing something like refreshing imported data is very complex of must be done manually.
|
@Akxe suppose I have an API that allows car dealerships to post their stock feed to my website. I want my API to be in sync with their website, so when they mark a car as sold, it is also marked as sold on my website. Any idea how to achieve this with Prisma in its current form? Thanks in advance! |
I am closing this for now, please open a new issue if you need MySQL's |
Actually I managed to achieve what I was looking for using create/update in nested writes within a for... of loop. I will take a look into PostGreSQL's ON CONFLICT. Thanks! |
Problem
I want to create an ez "insert ... on duplicate key update" query.
I see no reason why this should only be possible via a raw query.
The text was updated successfully, but these errors were encountered: