Update lint, fix for pg@7.x

This commit is contained in:
Brian M. Carlson 2019-10-25 18:11:53 -05:00
parent 4164686c4b
commit be0321299b
4 changed files with 6 additions and 8 deletions

View File

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

View File

@ -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": {

View File

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

View File

@ -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==