Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pg-copy-streams

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pg-copy-streams - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

3

copy-to.js

@@ -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 @@ }))

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc