drizzle-team / drizzle-team/drizzle-orm

[FEATURE]: omitApi like Prisma (be able to exclude/omit fields from queries in drizzle)

Open
#4,280 5 comments 18 reactions 0 assignees View on GitHub
enhancement rqb
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### Feature hasn't been suggested before.

- [x] I have verified this feature I'm about to request hasn't been suggested before.

### Describe the enhancement you want to request

Here's how this works with prisma:

```ts
const prisma = new PrismaClient({
omit: {
user: {
password: true
}
}
})

// The password field is excluded in all queries, including this one
const user = await prisma.user.findUnique({ where: { id: 1 } })
```
[link to prisma docs](https://www.prisma.io/docs/orm/prisma-client/queries/excluding-fields)

Excluding fields globally is a thing that we can take advantage of, since we already are in an ORM context.

Actually, this was a pull request that took years to be released in the prisma project, I wonder what is possible here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.