You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am unsure if it's a realistic request, but I couldn't find any discussion, issue, or PR alluding to upserts so I want to start the conversation.
Given that there is currently support for the findUnique Prisma API, and the create and update methods generate an encrypted field's hash counterpart, would it be possible to extend support to upsert? Perhaps beyond that question, would nested upsert operations also be possible?
The text was updated successfully, but these errors were encountered:
As long as the fields you want to use to check if a given record exists are either unencrypted or contain a hash to allow querying, this sounds like something that should be possible.
The encryption.ts file is where most of the logic lives.
It's based on a visitor pattern which walks the query you pass on writes, and encrypts/hashes what needs it. The encrypted query is forwarded to the DB by Prisma, and when the result comes back, the visitor walks the response and decrypts as needed.
Regarding upsert queries, I just realised that PR #123 added a test which uses an upsert, so it seems like it's supported already. Feel free to add some integration tests to try and fish out some implementation issues (particularly with nested upserts), that could be a good start (TDD style).
First of all, thank you for such a solid package!
I am unsure if it's a realistic request, but I couldn't find any discussion, issue, or PR alluding to upserts so I want to start the conversation.
Given that there is currently support for the
findUnique
Prisma API, and thecreate
andupdate
methods generate an encrypted field's hash counterpart, would it be possible to extend support toupsert
? Perhaps beyond that question, would nestedupsert
operations also be possible?The text was updated successfully, but these errors were encountered: