Parse/decode `numeric` columns as float/int
bombillazo opened this issue · 2 comments
Hello, is there any way to parse numeric column values as int
to float
? We are currently getting all values from our DB that are numeric
as string
.
I saw they library uses some decoders internally, is there any way to customize what fields one wants to parse as number to string?
Is it possible to base the decoders in this library:
https://github.com/denodrivers/postgres/blob/main/query/decode.ts
off this file:?
https://github.com/brianc/node-pg-types/blob/master/lib/textParsers.js#L143
After consideration, numeric is not safe to automatically parse to float or int due to value storage limits of the JS ints and floats. So, the proper approach is to return a string and give the developers an API that allows them to control the numeric type parsing as they need.