Comparing version 0.6.16 to 0.6.17
@@ -66,5 +66,5 @@ var crypto = require('crypto'); | ||
con.once('backendKeyData', function(msg) { | ||
self.processID = msg.processID; | ||
self.secretKey = msg.secretKey; | ||
}); | ||
self.processID = msg.processID; | ||
self.secretKey = msg.secretKey; | ||
}); | ||
@@ -143,18 +143,18 @@ //hook up query handling events to connection | ||
p.cancel = function(client, query) { | ||
if (client.activeQuery == query) { | ||
var con = this.connection; | ||
if (client.activeQuery == query) { | ||
var con = this.connection; | ||
if(this.host && this.host.indexOf('/') === 0) { | ||
con.connect(this.host + '/.s.PGSQL.' + this.port); | ||
} else { | ||
con.connect(this.port, this.host); | ||
} | ||
if(this.host && this.host.indexOf('/') === 0) { | ||
con.connect(this.host + '/.s.PGSQL.' + this.port); | ||
} else { | ||
con.connect(this.port, this.host); | ||
} | ||
//once connection is established send cancel message | ||
con.on('connect', function() { | ||
con.cancel(client.processID, client.secretKey); | ||
}); | ||
} | ||
else if (client.queryQueue.indexOf(query) != -1) | ||
client.queryQueue.splice(client.queryQueue.indexOf(query), 1); | ||
//once connection is established send cancel message | ||
con.on('connect', function() { | ||
con.cancel(client.processID, client.secretKey); | ||
}); | ||
} | ||
else if (client.queryQueue.indexOf(query) != -1) | ||
client.queryQueue.splice(client.queryQueue.indexOf(query), 1); | ||
}; | ||
@@ -161,0 +161,0 @@ |
@@ -64,3 +64,3 @@ var EventEmitter = require('events').EventEmitter; | ||
} | ||
self.emit('row', row); | ||
self.emit('row', row, self._result); | ||
@@ -67,0 +67,0 @@ //if there is a callback collect rows |
@@ -59,3 +59,3 @@ var arrayParser = require(__dirname + "/arrayParser.js"); | ||
if(entry != null) | ||
entry = parseInt(entry); | ||
entry = parseInt(entry, 10); | ||
@@ -87,8 +87,8 @@ return entry; | ||
var i = {}; | ||
if (m[2]) i.years = parseInt(m[2]); | ||
if (m[4]) i.months = parseInt(m[4]); | ||
if (m[6]) i.days = parseInt(m[6]); | ||
if (m[9]) i.hours = parseInt(m[9]); | ||
if (m[10]) i.minutes = parseInt(m[10]); | ||
if (m[11]) i.seconds = parseInt(m[11]); | ||
if (m[2]) i.years = parseInt(m[2], 10); | ||
if (m[4]) i.months = parseInt(m[4], 10); | ||
if (m[6]) i.days = parseInt(m[6], 10); | ||
if (m[9]) i.hours = parseInt(m[9], 10); | ||
if (m[10]) i.minutes = parseInt(m[10], 10); | ||
if (m[11]) i.seconds = parseInt(m[11], 10); | ||
if (m[8] == '-'){ | ||
@@ -114,7 +114,11 @@ if (i.hours) i.hours *= -1; | ||
var parseInteger = function(val) { | ||
return parseInt(val, 10); | ||
} | ||
var init = function(register) { | ||
register(20, parseInt); | ||
register(21, parseInt); | ||
register(23, parseInt); | ||
register(26, parseInt); | ||
register(20, parseInteger); | ||
register(21, parseInteger); | ||
register(23, parseInteger); | ||
register(26, parseInteger); | ||
register(1700, function(val){ | ||
@@ -121,0 +125,0 @@ if(val.length > maxLen) { |
{ "name": "pg", | ||
"version": "0.6.16", | ||
"version": "0.6.17", | ||
"description": "PostgreSQL client - pure javascript & libpq with the same API", | ||
@@ -4,0 +4,0 @@ "keywords" : ["postgres", "pg", "libpq", "postgre", "database", "rdbms"], |
@@ -122,2 +122,4 @@ #node-postgres | ||
* [ahtih](https://github.com/ahtih) | ||
* [chowey](https://github.com/chowey) | ||
* [kennym](https://github.com/kennym) | ||
@@ -124,0 +126,0 @@ ## Documentation |
217397
5900
169
88