node-postgres
node-postgres copied to clipboard
types/getTypeParser in query method doesn't work with pg-native?
Hello, I have simple code like this:
var pg = require("pg");
const client = new pg.Client();
// ...
client.query({
text: "SELECT num FROM data WHERE id = $1",
values: [1],
rowMode: "array",
types: {
getTypeParser: () => val => val,
}
},
(err, result) {
console.log(result.rows);
});
This works great and I get the expected output: [ [ "567" ] ]
But when I change the first "require" line to use "pg-native", like this:
var pg = require("pg").native;
then my custom parser seems to be ignored, and I get the following output: [ [ 567 ] ]
I am using:
- pg 8.7.1
- pg-native 3.0.0
Thank you
I've submitted a pull request to fix this: #2687