pg 7.7.0 → 7.8.2
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/.travis.yml +0 -3
- package/CHANGELOG.md +5 -0
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/SPONSORS.md +2 -0
- package/lib/client.js +1 -1
- package/lib/connection.js +1 -0
- package/lib/native/query.js +5 -1
- package/lib/query.js +4 -0
- package/package.json +4 -4
package/.travis.yml
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@ For richer information consult the commit log on github with referenced pull req
|
|
|
4
4
|
|
|
5
5
|
We do not include break-fix version release in this file.
|
|
6
6
|
|
|
7
|
+
### 7.8.0
|
|
8
|
+
|
|
9
|
+
- Add support for passing [secureOptions](https://github.com/brianc/node-postgres/pull/1804) SSL config.
|
|
10
|
+
- Upgrade [pg-types](https://github.com/brianc/node-postgres/pull/1806) to 2.0.
|
|
11
|
+
|
|
7
12
|
### 7.7.0
|
|
8
13
|
|
|
9
14
|
- Add support for configurable [query timeout](https://github.com/brianc/node-postgres/pull/1760) on a client level.
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -67,7 +67,7 @@ The causes and solutions to common errors can be found among the [Frequently Ask
|
|
|
67
67
|
|
|
68
68
|
## License
|
|
69
69
|
|
|
70
|
-
Copyright (c) 2010-
|
|
70
|
+
Copyright (c) 2010-2019 Brian Carlson (brian.m.carlson@gmail.com)
|
|
71
71
|
|
|
72
72
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
73
73
|
of this software and associated documentation files (the "Software"), to deal
|
package/SPONSORS.md
CHANGED
package/lib/client.js
CHANGED
|
@@ -276,7 +276,7 @@ Client.prototype._attachListeners = function (con) {
|
|
|
276
276
|
// it again on the same client
|
|
277
277
|
con.on('parseComplete', function (msg) {
|
|
278
278
|
if (self.activeQuery.name) {
|
|
279
|
-
con.parsedStatements[self.activeQuery.name] =
|
|
279
|
+
con.parsedStatements[self.activeQuery.name] = self.activeQuery.text
|
|
280
280
|
}
|
|
281
281
|
})
|
|
282
282
|
|
package/lib/connection.js
CHANGED
|
@@ -101,6 +101,7 @@ Connection.prototype.connect = function (port, host) {
|
|
|
101
101
|
key: self.ssl.key,
|
|
102
102
|
passphrase: self.ssl.passphrase,
|
|
103
103
|
cert: self.ssl.cert,
|
|
104
|
+
secureOptions: self.ssl.secureOptions,
|
|
104
105
|
NPNProtocols: self.ssl.NPNProtocols
|
|
105
106
|
})
|
|
106
107
|
self.attachListeners(self.stream)
|
package/lib/native/query.js
CHANGED
|
@@ -139,12 +139,16 @@ NativeQuery.prototype.submit = function (client) {
|
|
|
139
139
|
// check if the client has already executed this named query
|
|
140
140
|
// if so...just execute it again - skip the planning phase
|
|
141
141
|
if (client.namedQueries[this.name]) {
|
|
142
|
+
if (this.text && client.namedQueries[this.name] !== this.text) {
|
|
143
|
+
const err = new Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`)
|
|
144
|
+
return after(err)
|
|
145
|
+
}
|
|
142
146
|
return client.native.execute(this.name, values, after)
|
|
143
147
|
}
|
|
144
148
|
// plan the named query the first time, then execute it
|
|
145
149
|
return client.native.prepare(this.name, this.text, values.length, function (err) {
|
|
146
150
|
if (err) return after(err)
|
|
147
|
-
client.namedQueries[self.name] =
|
|
151
|
+
client.namedQueries[self.name] = self.text
|
|
148
152
|
return self.native.execute(self.name, values, after)
|
|
149
153
|
})
|
|
150
154
|
} else if (this.values) {
|
package/lib/query.js
CHANGED
|
@@ -148,6 +148,10 @@ Query.prototype.submit = function (connection) {
|
|
|
148
148
|
if (typeof this.text !== 'string' && typeof this.name !== 'string') {
|
|
149
149
|
return new Error('A query must have either text or a name. Supplying neither is unsupported.')
|
|
150
150
|
}
|
|
151
|
+
const previous = connection.parsedStatements[this.name]
|
|
152
|
+
if (this.text && previous && this.text !== previous) {
|
|
153
|
+
return new Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`)
|
|
154
|
+
}
|
|
151
155
|
if (this.values && !Array.isArray(this.values)) {
|
|
152
156
|
return new Error('Query values must be an array')
|
|
153
157
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pg",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.8.2",
|
|
4
4
|
"description": "PostgreSQL client - pure javascript & libpq with the same API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"database",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"main": "./lib",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"buffer-writer": "2.0.0",
|
|
23
|
-
"packet-reader": "0.
|
|
23
|
+
"packet-reader": "1.0.0",
|
|
24
24
|
"pg-connection-string": "0.1.3",
|
|
25
|
-
"pg-pool": "
|
|
26
|
-
"pg-types": "~
|
|
25
|
+
"pg-pool": "^2.0.4",
|
|
26
|
+
"pg-types": "~2.0.0",
|
|
27
27
|
"pgpass": "1.x",
|
|
28
28
|
"semver": "4.3.2"
|
|
29
29
|
},
|