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

pg-cursor

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pg-cursor - npm Package Compare versions

Comparing version 2.7.1 to 2.7.3

20

index.js

@@ -89,2 +89,4 @@ 'use strict'

_closePortal() {
if (this.state === 'done') return
// because we opened a named portal to stream results

@@ -101,2 +103,4 @@ // we need to close the same named portal. Leaving a named portal

}
this.state = 'done'
}

@@ -213,16 +217,10 @@

if (!this.connection || this.state === 'done') {
if (cb) {
return setImmediate(cb)
} else {
return
}
setImmediate(cb)
return promise
}
this._closePortal()
this.state = 'done'
if (cb) {
this.connection.once('readyForQuery', function () {
cb()
})
}
this.connection.once('readyForQuery', function () {
cb()
})

@@ -229,0 +227,0 @@ // Return the promise (or undefined)

{
"name": "pg-cursor",
"version": "2.7.1",
"version": "2.7.3",
"description": "Query cursor extension for node-postgres",

@@ -21,3 +21,3 @@ "main": "index.js",

"mocha": "^7.1.2",
"pg": "^8.7.1"
"pg": "^8.7.3"
},

@@ -27,3 +27,3 @@ "peerDependencies": {

},
"gitHead": "92b4d37926c276d343bfe56447ff6f526af757cf"
"gitHead": "4fa7ee891a456168a75695ac026792136f16577f"
}

@@ -26,2 +26,13 @@ const assert = require('assert')

it('can close a finished cursor a promise', function (done) {
const cursor = new Cursor(text)
this.client.query(cursor)
cursor.read(100, (err) => {
assert.ifError(err)
cursor.close().then(() => {
this.client.query('SELECT NOW()', done)
})
})
})
it('closes cursor early', function (done) {

@@ -28,0 +39,0 @@ const cursor = new Cursor(text)

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