This commit is contained in:
Brian M. Carlson 2019-01-08 08:52:05 -06:00
parent 0a1052516f
commit 1200da5c74
2 changed files with 1810 additions and 3 deletions

View File

@ -9,7 +9,7 @@ var nextUniqueID = 1 // concept borrowed from org.postgresql.core.v3.QueryExecut
function Cursor (text, values, config) {
EventEmitter.call(this)
this._conf = config || { }
this._conf = config || {}
this.text = text
this.values = values ? values.map(prepare) : null
this.connection = null
@ -148,7 +148,7 @@ Cursor.prototype.end = function (cb) {
if (this.state !== 'initialized') {
this.connection.sync()
}
this.connection.stream.once('end', cb)
this.connection.once('end', cb)
this.connection.end()
}
@ -156,7 +156,7 @@ Cursor.prototype.close = function (cb) {
if (this.state === 'done') {
return setImmediate(cb)
}
this.connection.close({type: 'P'})
this.connection.close({ type: 'P' })
this.connection.sync()
this.state = 'done'
if (cb) {

1807
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff