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 1.0.2 to 1.1.0

3

index.js

@@ -73,3 +73,4 @@ var Result = require('./pg').Result

if(cb) {
cb(null, this._rows)
this._result.rows = this._rows
cb(null, this._rows, this._result)
}

@@ -76,0 +77,0 @@ this._rows = []

{
"name": "pg-cursor",
"version": "1.0.2",
"version": "1.1.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -62,3 +62,3 @@ node-pg-cursor

#### cursor#read(int rowCount, function callback(Error err, Array rows)
#### cursor#read(int rowCount, function callback(Error err, Array rows, Result result)

@@ -69,2 +69,3 @@ Read `rowCount` rows from the cursor instance. The `callback` will be called when the rows are available, loaded into memory, parsed, and converted to JavaScript types.

`result` is a special [https://github.com/brianc/node-postgres/wiki/Query#result-object](Result) object that can be used to accumulate rows.

@@ -71,0 +72,0 @@ #### cursor#close(function callback(Error err))

@@ -119,2 +119,13 @@ var assert = require('assert')

})
it('returns result along with rows', function(done) {
var cursor = this.pgCursor(text)
cursor.read(1, function(err, rows, result) {
assert.ifError(err)
assert.equal(rows.length, 1)
assert.strictEqual(rows, result.rows)
assert.deepEqual(result.fields.map(f => f.name), ['num'])
done()
})
})
})
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