Skip to content

Commit d5dc421

Browse files
committed
Merge origin/master
2 parents 5341a2a + 1c8b6b9 commit d5dc421

File tree

24 files changed

+270
-28
lines changed

24 files changed

+270
-28
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ package-lock.json
88
dist
99
.DS_Store
1010
.vscode/
11+
manually-test-on-heroku.js

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ env:
1010
node_js:
1111
- lts/dubnium
1212
- lts/erbium
13+
# node 13.7 seems to have changed behavior of async iterators exiting early on streams
14+
# if 13.8 still has this problem when it comes down I'll talk to the node team about the change
15+
# in the mean time...peg to 13.6
1316
- 13.6
1417

1518
addons:

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ For richer information consult the commit log on github with referenced pull req
44

55
We do not include break-fix version release in this file.
66

7+
### pg@7.18.0
8+
9+
- This will likely be the last minor release before pg@8.0.
10+
- This version contains a few bug fixes and adds a deprecation warning for [a pending change in 8.0](https://github.com/brianc/node-postgres/issues/2009#issuecomment-579371651) which will flip the default behavior over SSL from `rejectUnauthorized` from `false` to `true` making things more secure in the general use case.
11+
712
### pg-query-stream@3.0.0
813

914
- [Rewrote stream internals](https://github.com/brianc/node-postgres/pull/2051) to better conform to node stream semantics. This should make pg-query-stream much better at respecting [highWaterMark](https://nodejs.org/api/stream.html#stream_new_stream_readable_options) and getting rid of some edge case bugs when using pg-query-stream as an async iterator. Due to the size and nature of this change (effectively a full re-write) it's safest to bump the semver major here, though almost all tests remain untouched and still passing, which brings us to a breaking change to the API....

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,21 @@ When you open an issue please provide:
5050

5151
You can also follow me [@briancarlson](https://twitter.com/briancarlson) if that's your thing. I try to always announce noteworthy changes & developments with node-postgres on Twitter.
5252

53-
### Sponsorship :star:
53+
## Sponsorship :two_hearts:
5454

55-
[If you or your company are benefiting from node-postgres and would like to help keep the project financially sustainable please consider supporting](https://github.com/sponsors/brianc) its development.
55+
node-postgres's continued development has been made possible in part by generous finanical support from [the community](https://github.com/brianc/node-postgres/blob/master/SPONSORS.md) and these featured sponsors:
5656

57-
Also, you can view a historical list of all [previous and existing sponsors](https://github.com/brianc/node-postgres/blob/master/SPONSORS.md).
57+
<div align="center">
58+
<a href="https://www.timescale.com" target="_blank">
59+
<img height="80" src="https://node-postgres.com/timescale.svg" />
60+
</a>
61+
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAABCAQAAAB0m0auAAAADElEQVR42mNkIBIAAABSAAI2VLqiAAAAAElFTkSuQmCC" />
62+
<a href="https://crate.io" target="_blank">
63+
<img height="80" src="https://node-postgres.com/crate-io.png" />
64+
</a>
65+
</div>
66+
67+
If you or your company are benefiting from node-postgres and would like to help keep the project financially sustainable [please consider supporting](https://github.com/sponsors/brianc) its development.
5868

5969
## Contributing
6070

SPONSORS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
node-postgres is made possible by the helpful contributors from the community well as the following generous supporters on [Patreon](https://www.patreon.com/node_postgres).
1+
node-postgres is made possible by the helpful contributors from the community as well as the following generous supporters on [GitHub Sponsors](https://github.com/sponsors/brianc) and [Patreon](https://www.patreon.com/node_postgres).
22

33
# Leaders
44

55
- [MadKudu](https://www.madkudu.com) - [@madkudu](https://twitter.com/madkudu)
66
- [Third Iron](https://thirdiron.com/)
77
- [Timescale](https://timescale.com)
88
- [Nafundi](https://nafundi.com)
9+
- [CrateDB](https://crate.io/)
910

1011
# Supporters
1112

lerna.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"useWorkspaces": true,
77
"version": "independent",
88
"ignoreChanges": [
9-
"**/*.md"
9+
"**/*.md",
10+
"**/test/**"
1011
]
1112
}

packages/pg-cursor/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pg-cursor",
3-
"version": "2.1.3",
3+
"version": "2.1.6",
44
"description": "Query cursor extension for node-postgres",
55
"main": "index.js",
66
"directories": {
@@ -21,7 +21,7 @@
2121
"eslint-config-prettier": "^6.4.0",
2222
"eslint-plugin-prettier": "^3.1.1",
2323
"mocha": "^6.2.2",
24-
"pg": "^7.17.1",
24+
"pg": "^7.18.2",
2525
"prettier": "^1.18.2"
2626
},
2727
"prettier": {

packages/pg-pool/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ class PendingItem {
2525
}
2626
}
2727

28+
function throwOnDoubleRelease () {
29+
throw new Error('Release called on client which has already been released to the pool.')
30+
}
31+
2832
function promisify (Promise, callback) {
2933
if (callback) {
3034
return { callback: callback, result: undefined }
@@ -256,7 +260,7 @@ class Pool extends EventEmitter {
256260

257261
client.release = (err) => {
258262
if (released) {
259-
throw new Error('Release called on client which has already been released to the pool.')
263+
throwOnDoubleRelease()
260264
}
261265

262266
released = true
@@ -292,7 +296,8 @@ class Pool extends EventEmitter {
292296
_release (client, idleListener, err) {
293297
client.on('error', idleListener)
294298

295-
if (err || this.ending) {
299+
// TODO(bmc): expose a proper, public interface _queryable and _ending
300+
if (err || this.ending || !client._queryable || client._ending) {
296301
this._remove(client)
297302
this._pulseQueue()
298303
return

packages/pg-pool/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pg-pool",
3-
"version": "2.0.9",
3+
"version": "2.0.10",
44
"description": "Connection pool for node-postgres",
55
"main": "index.js",
66
"directories": {

packages/pg-pool/test/error-handling.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,14 @@ describe('pool error handling', function () {
211211
const pool = new Pool({ max: 1, port: closeServer.address().port, host: 'localhost' })
212212
pool.connect((err) => {
213213
expect(err).to.be.an(Error)
214-
if (err.errno) {
215-
expect(err.errno).to.be('ECONNRESET')
214+
if (err.code) {
215+
expect(err.code).to.be('ECONNRESET')
216216
}
217217
})
218218
pool.connect((err) => {
219219
expect(err).to.be.an(Error)
220-
if (err.errno) {
221-
expect(err.errno).to.be('ECONNRESET')
220+
if (err.code) {
221+
expect(err.code).to.be('ECONNRESET')
222222
}
223223
closeServer.close(() => {
224224
pool.end(done)

0 commit comments

Comments
 (0)