Prisma Client returns incompatible BigInt type for fields
See original GitHub issueBug description
When we use JS BigInt feature from ES2020, TypeScript uses the lowercase bigint primitive type, just like number vs. Number:

However, Prisma Client returns BigInt interface, which is incompatible with that bigint type:

How to reproduce
Create a Prisma model with BigInt columns and use Prisma Client method like .findFirst() to get the data.
Then try to assign to a property/variable of bigint primitive type.
Expected behavior
Prisma Client should return primitive bigint type, just like it do with string or number.
Prisma information
model reveal {
operation_id BigInt @id
fee BigInt
}
Environment & setup
- OS: Ubuntu 20.04
- Database: PostgreSQL
- Node.js version: 15.8
- Prisma version:
prisma : 2.17.0
@prisma/client : 2.17.0
Current platform : debian-openssl-1.1.x
Query Engine : query-engine 3c463ebd78b1d21d8fdacdd27899e280cf686223 (at node_modules/@prisma/engines/query-engine-debian-openssl-1.1.x)
Migration Engine : migration-engine-cli 3c463ebd78b1d21d8fdacdd27899e280cf686223 (at node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine : introspection-core 3c463ebd78b1d21d8fdacdd27899e280cf686223 (at node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary : prisma-fmt 3c463ebd78b1d21d8fdacdd27899e280cf686223 (at node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Studio : 0.353.0
Preview Features : orderByRelation
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Prisma schema API (Reference)
API reference documentation for the Prisma Schema Language (PSL). ... is enforced by foreign keys in the database or emulated in the Prisma...
Read more >Working with fields (Concepts) - Prisma
BigInt fields are represented by the BigInt type (Node.js 10.4.0+ required). The following example demonstrates how to use the BigInt type:.
Read more >Error message reference - Prisma
Prisma Client throws a PrismaClientUnknownRequestError exception if the query engine returns an error related to a request that does not have an error...
Read more >Upgrade to Prisma 4
Prisma 4 introduces a number of breaking changes when you upgrade from an earlier Prisma version. This guide explains how this upgrade might...
Read more >PostgreSQL database connector (Reference) - Prisma
This page explains how Prisma can connect to a PostgreSQL database using the ... native database types that are not yet supported as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Facing same trouble with latest version of prisma. Older version is working good
Thanks a lot for reporting 🙏 This issue is fixed in the latest dev version of
@prisma/client. You can try it out withnpm i @prisma/client@dev.In case it’s not fixed for you - please let us know and we’ll reopen this issue!