Comparing version 0.1.3 to 0.2.0
22
index.js
@@ -35,7 +35,15 @@ var Result = require('./pg').Result | ||
con.flush() | ||
con.once('noData', ifNoData) | ||
con.once('rowDescription', function () { | ||
con.removeListener('noData', ifNoData); | ||
}); | ||
function ifNoData () { | ||
self.state = 'idle' | ||
self._shiftQueue(); | ||
} | ||
} | ||
Cursor.prototype.handleRowDescription = function(msg) { | ||
this._result.addFields(msg.fields) | ||
this.state = 'idle' | ||
Cursor.prototype._shiftQueue = function () { | ||
if(this._queue.length) { | ||
@@ -46,2 +54,8 @@ this._getRows.apply(this, this._queue.shift()) | ||
Cursor.prototype.handleRowDescription = function(msg) { | ||
this._result.addFields(msg.fields) | ||
this.state = 'idle' | ||
this._shiftQueue(); | ||
} | ||
Cursor.prototype.handleDataRow = function(msg) { | ||
@@ -108,3 +122,3 @@ var row = this._result.parseRow(msg.fields) | ||
Cursor.prototype.end = function(cb) { | ||
if(this.statue != 'initialized') { | ||
if(this.state != 'initialized') { | ||
this.connection.sync() | ||
@@ -111,0 +125,0 @@ } |
{ | ||
"name": "pg-cursor", | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"description": "", | ||
@@ -10,3 +10,3 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "node test/" | ||
"test": "mocha test/" | ||
}, | ||
@@ -13,0 +13,0 @@ "author": "Brian M. Carlson", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12501
9
300