Closed PaiJi closed 3 years ago
This is out of range for our integer type (64 bit signed integer), and also out of range for double precision floats (without precision loss). This means it cannot be represented at the database level without a proper decimal
or bigint
representation, which we do not support yet.
I will tag this issue so we can refer to it when we tackle support for a broader set of database types (it's fairly high priority). Thank you for reporting this :)
Quick evcxr debugging session dump:
tom-prisma.tom.~/src/prisma-engine λ evcxr
Welcome to evcxr. For help, type :help
>> extern crate rust_decimal;
>>
>> let i: u64 = 90071992547409910000000000;
^^^^^^^^^^^^^^^^^^^^^^^^^^
literal out of range for `u64`
>> use rust_decimal::Decimal;
>> let dec: Decimal = "90071992547409910000000000".parse().unwrap();
>> dec
90071992547409910000000000
>> use rust_decimal::prelude::*;
>> dec
90071992547409910000000000
>> dec.to_f64()
None
>> let f: f64 = 90071992547409910000000000.0;
>> f
90071992547409900000000000.0
>>
BigInt is now available in the native types preview: https://www.prisma.io/docs/concepts/components/preview-features/native-types#additional-prisma-types
if you query a bignumber like 90071992547409910000000000, then prisma direct crash:
Environment & setup