create OR connect on nested writes (upsert) #336
Comments
You can open an issue about this in the specs repo so that we can include it in the upcoming photonjs API changes: https://github.com/prisma/specs Also, checkout photonjs spec: https://github.com/prisma/specs/tree/master/photonjs |
Internal Note: We do have nested upsert but we only expose it within an update. Exposing this might be very simple. It is mostly writing a few test cases i assume. |
Any plans to implement this? @mavilein |
Just realized that we already have a more prominent issue for this feature request: prisma/prisma1#2194 |
That one is for Prisma1 though, which we do not look into around here ;) |
so a feature thats been requested since 2018 and might be very simple. sounds like a good candidate @mavilein :) |
@ssalbdivad not no mention actually support transactions which the boilerplate workaround does not. |
this would be awesome when it works! 🤗 |
The |
This comment has been minimized.
This comment has been minimized.
Moved into separate issue #764 @RoaldSchuring |
is there a plan to add an upsert to nested writes? The use case is when you dont know if the nested record exists or not
say im creating a
movie
with a list of nactors
, some already exist and some do not.using either
create
orconnect
wont work since i dont know beforehand which exist or not.the only current solution is to loop and upsert the entire list and then always use
connect
.so instead of
connect
,create
also add anupsert
but instead
the first one is not very ACID obviously.
The text was updated successfully, but these errors were encountered: