denodrivers/postgres

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?

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.