PrismaP
Prisma13mo ago
23 replies
pilfer

The "omit" field type is not generated for Prisma client - v6.2.0

While attempting to play with the new omit exclusion feature (here: https://www.prisma.io/docs/orm/prisma-client/queries/excluding-fields#excluding-a-field-globally-using-omit), I found what may be a generator bug.

I'm seeing the typescript error of, Object literal may only specify known properties, and 'omit' does not exist in type 'Subset<PrismaClientOptions, PrismaClientOptions>' when attempting to use
new PrismaClient({ omit: { user: password } }).

I'm using prisma version 6.2.0 and I have already regenerated the client multiple times.

The generated node_modules/.prisma/client/index.d.ts file doesn't included the omit field, despite it existing here: https://github.com/prisma/prisma/blob/6.2.0/packages/client/src/runtime/getPrismaClient.ts#L134C2-L134C27

It does generate if I use the previewFeatures = ["omitApi"] feature flag, but
npx prisma generate
throws a warning of Preview feature "omitApi" is deprecated. The functionality can be used without specifying it as a preview feature..


Am I doing something wrong, or is this just a bug?
This page explains how to exclude sensitive fields from Prisma Client
Excluding fields | Prisma Documentation
GitHub
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB - prisma/prisma
prisma/packages/client/src/runtime/getPrismaClient.ts at 6.2.0 · pr...
Was this page helpful?