-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Feature Request: Support upserts #126
Comments
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. Would you like to open a PR? |
Very cool. Yes, I am definitely interested in contributing. Do you have any suggestions on how to approach it or where to get started? I'll aim to get familiar with the repo this weekend. Thanks! |
The 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: