Closed gevera closed 2 years ago
Hi @gevera. Sorry for late reply.
BigInt is actually returned as string in javascript as default, by most postgres database clients. This is because bigint is 64 bit integer, however, javascript supports integer values up to 53 bits (numbers in javascript are 64 bit floats), higher numbers will start having rounding errors, which can be disastrous when dealing with database fields like ids.
Alternatively, javascript has a dedicated type BigInt, which can be enabled in pg-typegen, by setting the "bigint" flag. However, if you do use BigInt, keep in mind that there will be JSON serialization issues to consider. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt
That makes sense. I guess we can close the issue
Hi there. I've noticed an issue while generating types
Result
Expected the id to be a number and not a string
And thank you for this great library