[FEATURE]: omitApi like Prisma (be able to exclude/omit fields from queries in drizzle)
Author: fgcoelhoCreated Mar 16, 2025Updated Sep 15, 2026
Labelsenhancementrqb
Feature hasn't been suggested before.
- 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:
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 } })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.
Source: drizzle-team/drizzle-orm