Feature 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 } })
link to prisma docs
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.