From be0321299bc53542f41754275f6ea2164f5435f5 Mon Sep 17 00:00:00 2001 From: "Brian M. Carlson" Date: Fri, 25 Oct 2019 18:11:53 -0500 Subject: [PATCH] Update lint, fix for pg@7.x --- index.js | 4 +--- package.json | 4 ++-- test/index.js | 4 ++-- yarn.lock | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index 202cd9b6..8136c389 100644 --- a/index.js +++ b/index.js @@ -15,7 +15,7 @@ function Cursor(text, values, config) { this.connection = null this._queue = [] this.state = 'initialized' - this._result = new Result(this._conf.rowMode) + this._result = new Result(this._conf.rowMode, this._conf.types) this._cb = null this._rows = null this._portal = null @@ -155,7 +155,6 @@ Cursor.prototype._getRows = function(rows, cb) { } Cursor.prototype.end = function(cb) { - console.log(this.state) if (this.state !== 'initialized') { this.connection.sync() } @@ -178,7 +177,6 @@ Cursor.prototype.close = function(cb) { } Cursor.prototype.read = function(rows, cb) { - console.log('state', this.state) if (this.state === 'idle') { return this._getRows(rows, cb) } diff --git a/package.json b/package.json index 233f3e1a..e3530972 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pg-cursor", "version": "2.0.0", - "description": "", + "description": "Query cursor extension for node-postgres", "main": "index.js", "directories": { "test": "test" @@ -20,7 +20,7 @@ "eslint-config-prettier": "^6.4.0", "eslint-plugin-prettier": "^3.1.1", "mocha": "^6.2.2", - "pg": "^7.12.1", + "pg": "7.x", "prettier": "^1.18.2" }, "prettier": { diff --git a/test/index.js b/test/index.js index 81c3703f..0f41f882 100644 --- a/test/index.js +++ b/test/index.js @@ -27,12 +27,12 @@ describe('cursor', function() { }) }) - it.only('end before reading to end', function(done) { + it('end before reading to end', function(done) { const cursor = this.pgCursor(text) cursor.read(3, function(err, res) { assert.ifError(err) assert.equal(res.length, 3) - cursor.end(done) + done() }) }) diff --git a/yarn.lock b/yarn.lock index 63b1a42b..51b9a87f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -906,7 +906,7 @@ pg-types@^2.1.0: postgres-date "~1.0.4" postgres-interval "^1.1.0" -pg@^7.12.1: +pg@7.x: version "7.12.1" resolved "https://registry.yarnpkg.com/pg/-/pg-7.12.1.tgz#880636d46d2efbe0968e64e9fe0eeece8ef72a7e" integrity sha512-l1UuyfEvoswYfcUe6k+JaxiN+5vkOgYcVSbSuw3FvdLqDbaoa2RJo1zfJKfPsSYPFVERd4GHvX3s2PjG1asSDA==