numeric[] should be parsed via parseStringArray(...) not parseFloatArray(...)
Closed this issue · 4 comments
Arrays of numeric type are registered to be parsed as an arrays of floats whereas the non-array numeric is returned as a string to ensure to no loss of precision:
node-pg-types/lib/textParsers.js
Line 189 in d9d9dfb
It should instead return back an array of the string values so the user gets the full value.
This would be a breaking change to anyone previously expecting an array of Numbers.
Good point, would appreciate a PR for this
Yes this shouldn't be much as it's mainly removing special handling so the default string array handling kicks in.
I took a peek at the binary handlers and looks like there's another inconsistency in that case a non-array numeric is returned as a Number:
node-pg-types/lib/binaryParsers.js
Lines 114 to 132 in d9d9dfb
Should be a string to match the text format right?
Yes that sounds right. @charmander would you be able to take a look and confirm? Noticed you've worked on this and related packages somewhat recently.
Closed via #88