Bug description
If you use model named Record in your schema.prisma, this leads to errors
For example, there is _Strict type in .prisma/client/index.d.ts file:
type _Strict<U, _U = U> = U extends unknown ? U & OptionalFlat<Record<Exclude<Keys<_U>, keyof U>, never>> : never;
You can see using type Record which should be described in typesript/lib/lib.es5.d.ts
But if you have your own Record model, its type shadowed typescript definition, and many types in .prisma/client/index.d.ts file are inferred incorrectly
How to reproduce
- Create a schema with
User and Record models
- Generate prisma client
- Try to call
prisma.user.count()
Expected behavior
Result type should be number
Environment & setup
- OS: Windows
- Database: PostgreSQL
- Node.js version: 14.15.4
- Prisma version: 2.16.0
Bug description
If you use model named
Recordin yourschema.prisma, this leads to errorsFor example, there is
_Stricttype in.prisma/client/index.d.tsfile:You can see using type
Recordwhich should be described intypesript/lib/lib.es5.d.tsBut if you have your own
Recordmodel, its type shadowed typescript definition, and many types in.prisma/client/index.d.tsfile are inferred incorrectlyHow to reproduce
UserandRecordmodelsprisma.user.count()Expected behavior
Result type should be
numberEnvironment & setup