some.entity.ts
amount:number
But when I store a very large data in my postgres it throws error '''integer out of range'''
My question is how can I store Big Int as type in psql using typeorm
Define type bigint in @Column decorator,
@Column({type: 'bigint'})
columnName: string;
Note: that based on TypeOrm documentation bigint is mapped to string.
Just add { bigNumberStrings: false } to TypeORM's configuration, such as:
TypeOrmModule.forRoot({
bigNumberStrings: false,
...config.database,
}),
Then the bigint will return number type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With