Closed sehrope closed 5 years ago
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: https://github.com/brianc/node-pg-types/blob/d9d9dfb87eb50914043cbc178c301b7dd3b0c50d/lib/binaryParsers.js#L114-L132
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
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:
https://github.com/brianc/node-pg-types/blob/d9d9dfb87eb50914043cbc178c301b7dd3b0c50d/lib/textParsers.js#L189
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.