Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

big int #265

Open
Mario-35 opened this issue Oct 1, 2020 · 1 comment
Open

big int #265

Mario-35 opened this issue Oct 1, 2020 · 1 comment

Comments

@Mario-35
Copy link

Mario-35 commented Oct 1, 2020

Hello and great job

add bigint in list in file : update-types.ts
const type = ["integer", "numeric", "decimal"].includes(x.type)

because it put it like a string

@koistya
Copy link
Member

koistya commented Nov 12, 2020

It is a safe default. It's possible to cast to to BigInt instead. For this to work, you would also need to add a custom type parser in pg Postgres client:

import { types } from "pg";

types.setTypeParser(20, BigInt); // Type Id 20 = BIGINT | BIGSERIAL

or, if you want an integer, it would be:

types.setTypeParser(20, x => parseInt(x));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants