github (Housing) issues
Other tags in Housing
Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments
github (Housing)
PostgreSQL: `Int` type should be able to be mapped to `@db.BigInt` (int8)
## Problem At the moment, the only way to use PG's `int8` column type is by specifying `BigInt` type in the schema, which maps to Js's `bigint` type. But there are use cases in which we want to use JS's `number` type. Can have a way of using PG's `int8` column type which maps to a `number` type in JS? I know maximum value for PostgreSQL's int8 is `9223372036854775807`, which is out of range of JS's number max value (`9007199254740991`). But maybe that can be written as a warning in the documentation? ## Suggested solution We should be able to do: ```prisma model MyModel { myBigNumber Int @db.BigInt } ``` ## Alternatives Can't think of any. Thanks :slightly_smiling_face: (related discussion: https://github.com/prisma/prisma/discussions/6948) **EDIT** Fixed wrong claims about JS maximum value for number
Comments (0)
No comments yet. Start the discussion.