mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
nulls supported in all currently supported type coercions
This commit is contained in:
parent
a928453d69
commit
405fbbec12
@ -213,7 +213,9 @@ p.onDataRow = function(msg) {
|
||||
var converters = this.converters || [];
|
||||
var len = msg.fields.length;
|
||||
for(var i = 0; i < len; i++) {
|
||||
fields[i] = this.converters[i] (fields[i]);
|
||||
if(fields[i] !== null) {
|
||||
fields[i] = this.converters[i] (fields[i]);
|
||||
}
|
||||
}
|
||||
msg.fields = fields;
|
||||
this.emit('row', msg);
|
||||
|
||||
@ -58,6 +58,11 @@ test('typed results', function() {
|
||||
dataTypeID: 16,
|
||||
actual: 'f',
|
||||
expected: false
|
||||
},{
|
||||
name: 'boolean null',
|
||||
dataTypeID: 16,
|
||||
actual: null,
|
||||
expected: null
|
||||
}];
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user