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

pg-copy-streams

Package Overview
Dependencies
Maintainers
3
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 2.1.0 to 2.2.0

6

index.js

@@ -33,8 +33,6 @@ 'use strict';

var copyDataBuffer = Buffer.from([code.CopyData])
CopyStreamQuery.prototype._transform = function(chunk, enc, cb) {
var Int32Len = 4;
this.push(copyDataBuffer)
var lenBuffer = Buffer.alloc(Int32Len)
lenBuffer.writeUInt32BE(chunk.length + Int32Len, 0)
var lenBuffer = Buffer.from([code.CopyData, 0, 0, 0, 0])
lenBuffer.writeUInt32BE(chunk.length + Int32Len, 1)
this.push(lenBuffer)

@@ -41,0 +39,0 @@ this.push(chunk)

{
"name": "pg-copy-streams",
"version": "2.1.0",
"version": "2.2.0",
"description": "Low-Level COPY TO and COPY FROM streams for PostgreSQL in JavaScript using",

@@ -27,3 +27,5 @@ "main": "index.js",

"async": "~0.2.10",
"benchmark": "^2.1.4",
"concat-stream": "~1.1.0",
"duplex-child-process": "^1.0.0",
"gonna": "0.0.0",

@@ -30,0 +32,0 @@ "heroku-env": "~0.1.1",

@@ -73,2 +73,22 @@ ## pg-copy-streams

## benchmarks
The COPY command is commonly used to move huge sets of data. This can put some pressure on the node.js loop, the amount of CPU or the amount of memory used.
There is a bench/ directory in the repository where benchmark scripts are stored. If you have performance issues with `pg-copy-stream` do not hesitate to write a new benchmark that highlights your issue. Please avoid to commit huge files (PR won't be accepted) and find other ways to generate huge datasets.
If you have a local instance of postgres on your machine, you can start a benchmark for example with
```sh
$ cd bench
$ PGPORT=5432 PGDATABASE=postgres node copy-from.js
```
## tests
In order to launch the test suite, you need to have a local instance of postgres running on your machine.
```sh
$ PGPORT=5432 PGDATABASE=postgres make test
```
## contributing

@@ -91,2 +111,11 @@

### version 2.2.0 - published YYYY-MM-DD
* Small refactor in copy-from passing from 3 push to 2 push in every chunk transform loop
* Add bench/ directory for benchmarks
* Add benchmark to compare performance of pg-copy-stream wrt psql during copy-from
* Add benchmark to measure memory usage of copy-from
### version 2.1.0 - published 2019-03-19
* Change README to stop using the pg pool singleton (removed after pg 7.0)

@@ -93,0 +122,0 @@ * Do not register copy-to.pushBufferIfNeeded on the instance itself (avoid dangling method on the object)

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