pg 8.9.0 → 8.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +3 -1
- package/lib/connection.js +0 -3
- package/package.json +3 -3
package/lib/client.js
CHANGED
|
@@ -37,6 +37,7 @@ class Client extends EventEmitter {
|
|
|
37
37
|
this._Promise = c.Promise || global.Promise
|
|
38
38
|
this._types = new TypeOverrides(c.types)
|
|
39
39
|
this._ending = false
|
|
40
|
+
this._ended = false
|
|
40
41
|
this._connecting = false
|
|
41
42
|
this._connected = false
|
|
42
43
|
this._connectionError = false
|
|
@@ -132,6 +133,7 @@ class Client extends EventEmitter {
|
|
|
132
133
|
|
|
133
134
|
clearTimeout(this.connectionTimeoutHandle)
|
|
134
135
|
this._errorAllQueries(error)
|
|
136
|
+
this._ended = true
|
|
135
137
|
|
|
136
138
|
if (!this._ending) {
|
|
137
139
|
// if the connection is ended without us calling .end()
|
|
@@ -603,7 +605,7 @@ class Client extends EventEmitter {
|
|
|
603
605
|
this._ending = true
|
|
604
606
|
|
|
605
607
|
// if we have never connected, then end is a noop, callback immediately
|
|
606
|
-
if (!this.connection._connecting) {
|
|
608
|
+
if (!this.connection._connecting || this._ended) {
|
|
607
609
|
if (cb) {
|
|
608
610
|
cb()
|
|
609
611
|
} else {
|
package/lib/connection.js
CHANGED
|
@@ -108,9 +108,6 @@ class Connection extends EventEmitter {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
attachListeners(stream) {
|
|
111
|
-
stream.on('end', () => {
|
|
112
|
-
this.emit('end')
|
|
113
|
-
})
|
|
114
111
|
parse(stream, (msg) => {
|
|
115
112
|
var eventName = msg.name === 'error' ? 'errorMessage' : msg.name
|
|
116
113
|
if (this._emitMessage) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pg",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.10.0",
|
|
4
4
|
"description": "PostgreSQL client - pure javascript & libpq with the same API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"database",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"buffer-writer": "2.0.0",
|
|
24
24
|
"packet-reader": "1.0.0",
|
|
25
25
|
"pg-connection-string": "^2.5.0",
|
|
26
|
-
"pg-pool": "^3.
|
|
26
|
+
"pg-pool": "^3.6.0",
|
|
27
27
|
"pg-protocol": "^1.6.0",
|
|
28
28
|
"pg-types": "^2.1.0",
|
|
29
29
|
"pgpass": "1.x"
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">= 8.0.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "ee302cbcf10437e34fd05d70fc003c357b14c654"
|
|
57
57
|
}
|