47ng / 47ng/prisma-field-encryption

Feature Request: Support upserts

未关闭
#126 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
306
派生
40
PR 合并指标
30 天内没有已合并 PR

描述

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](https://www.prisma.io/docs/orm/reference/prisma-client-reference#upsert) 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 issue mentions extending the existing middleware to support the Prisma `upsert` operation and possibly nested upserts. Start by examining the current implementation of `findUnique`, `create`, and `update` handlers in the codebase to understand how field encryption is applied. Look for the middleware or hook files that intercept Prisma operations. Determine how to modify the logic to handle the conditional create/update flow of an upsert, ensuring encrypted fields are properly hashed. Check if there are existing tests for other operations to use as a reference for writing tests for upsert.

由索引模型根据 Issue 内容生成。

评估

技术栈
typescript
领域
backend-api-design, databases
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。