schemats icon indicating copy to clipboard operation
schemats copied to clipboard

bigint should be typed as "string" instead of "number" by default

Open ellis opened this issue 7 years ago • 3 comments

node-postgres returns Bigint columns as strings instead of numbers (by default), because they can be larger than javascript numbers. Could you please modify schemats to use "string" for bigint columns instead of "number"?

ellis avatar May 29 '18 07:05 ellis

it would be even better if configurable, because it's quite usual to override node-postgres parser settings in order to parse bigint as integer. See https://github.com/SweetIQ/schemats/issues/51

abenhamdine avatar May 29 '18 08:05 abenhamdine

FYI, I patched the code here: https://github.com/ellis/schemats/commit/e2defb8214775ec733357adbb7ca8525210b4a64

ellis avatar Jun 20 '18 09:06 ellis

Note that TypeScript 3.2 adds support for bigint type.

https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-2.html#bigint

narkowicz avatar Feb 26 '19 01:02 narkowicz