Type: type inference bug. Target: prisma/orm SQL ORM client.
Run npm run typecheck in the standalone reproduction. include-types.ts compares these native queries over its generated contract:
native.orm.public.Post.include("comments", c => c.include("author")).first();
native.orm.public.Post.include("comments", c =>
c.select("id").include("author", a => a.select("id"))
).first();
The first query's comment id is inferred as unknown; assigning it to string | undefined fails. Explicitly selecting the same nested scalar preserves string | undefined. Both paths should retain the generated schema's field types, including when selection is implicit. The reproduction's @ts-expect-error records the native defect and should become unused when fixed. No type cast or authorization-adapter import is involved.
Relevant regression coverage includes default and explicit root/nested selections, optional and required to-one includes, multiple to-many nesting levels, scalar codecs, nullable fields, and include reducers. This report is limited to default-selection inference loss.
Primary source: ORM types, collection.
Environment
@prisma/orm-postgres: 8.0.0-rc.8 (the live latest tag when reverified September 6, 2026)
- Prisma CLI:
8.0.0-rc.13
- TypeScript:
5.9.3
- Node:
26.5.0
- npm:
11.17.0
- OS: macOS 26.6.2 arm64
- PostgreSQL:
14.23 for database-backed cases
Type: type inference bug. Target: prisma/orm SQL ORM client.
Run
npm run typecheckin the standalone reproduction.include-types.tscompares these native queries over its generated contract:The first query's comment
idis inferred asunknown; assigning it tostring | undefinedfails. Explicitly selecting the same nested scalar preservesstring | undefined. Both paths should retain the generated schema's field types, including when selection is implicit. The reproduction's@ts-expect-errorrecords the native defect and should become unused when fixed. No type cast or authorization-adapter import is involved.Relevant regression coverage includes default and explicit root/nested selections, optional and required to-one includes, multiple to-many nesting levels, scalar codecs, nullable fields, and include reducers. This report is limited to default-selection inference loss.
Primary source: ORM types, collection.
Environment
@prisma/orm-postgres:8.0.0-rc.8(the livelatesttag when reverified September 6, 2026)8.0.0-rc.135.9.326.5.011.17.014.23for database-backed cases