pg-copy-streams
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -13,2 +13,3 @@ module.exports = function(txt) { | ||
this._copyOutResponse = null | ||
this.rowCount = 0 | ||
} | ||
@@ -82,3 +83,3 @@ | ||
this.push(slice) | ||
this.emit('row') | ||
this.rowCount++ | ||
} else { | ||
@@ -85,0 +86,0 @@ break; |
@@ -20,2 +20,3 @@ var CopyToQueryStream = require('./copy-to') | ||
this._copyOutResponse = null | ||
this.rowCount = 0 | ||
} | ||
@@ -43,3 +44,3 @@ | ||
this.push(chunk) | ||
this.emit('row') | ||
this.rowCount++ | ||
cb() | ||
@@ -46,0 +47,0 @@ } |
{ | ||
"name": "pg-copy-streams", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Low-Level COPY TO and COPY FROM streams for PostgreSQL in JavaScript using", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -39,3 +39,3 @@ var assert = require('assert') | ||
var firstRowDone = gonna('have correct result') | ||
assert.equal(rowEmitCount, top, 'should have emitted "row" event ' + top + ' times') | ||
assert.equal(stream.rowCount, top, 'should have rowCount ' + top + ' ') | ||
fromClient.query('SELECT (max(num)) AS num FROM numbers', function(err, res) { | ||
@@ -42,0 +42,0 @@ assert.ifError(err) |
@@ -21,6 +21,2 @@ var assert = require('assert') | ||
var stream = fromClient.query(copy(txt)) | ||
var rowEmitCount = 0 | ||
stream.on('row', function() { | ||
rowEmitCount++ | ||
}) | ||
var done = gonna('finish piping out', 1000, function() { | ||
@@ -34,3 +30,3 @@ fromClient.end() | ||
assert.equal(res, expected) | ||
assert.equal(rowEmitCount, top, 'should have emitted "row" ' + top + ' times but got ' + rowEmitCount) | ||
assert.equal(stream.rowCount, top, 'should have rowCount ' + top + ' but got ' + stream.rowCount) | ||
done() | ||
@@ -37,0 +33,0 @@ })) |
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
7126
222