2383 Commits

Author SHA1 Message Date
Charmander
c1f954b7a6 Remove unreachable branch in parseE (#2020)
The message is created with a fixed name.

56b7c4168d5aa084b2821279ee88d437a2b7636d, released in pg 2.4.0, was when this became applicable and the type of a `notice` event’s argument changed to an Error.
2019-12-12 08:15:53 -08:00
Adam Nielsen
b03a3bd76d Clear connection timeout on error (#2015)
Cancel the connection timeout upon stream error, to avoid getting a stream error followed later by a connection error.
2019-12-12 08:15:19 -08:00
Charmander
8f56b8c2fd Add PostgreSQL 10 to CI (#1947)
* Exit with error code when create-test-tables fails

* Add PostgreSQL 10 to CI

and change to Ubuntu 18.04 so building OpenSSL isn’t necessary, and move old PostgreSQL version tests to the latest Node LTS.

* Add Node 13 to CI

* Preserve create-test-tables’s compatibility with PostgreSQL <9.4
2019-11-20 17:38:40 -06:00
Brian M. Carlson
30f67bb246 Bump version v7.14.0 2019-11-20 10:14:48 -06:00
Brian M. Carlson
b05ea526b8 Update changelog 2019-11-20 10:14:04 -06:00
Brian C
510a273ce4
Revert "Support additional tls.connect() options (#1996)" (#2010)
This reverts commit bf029c827049ca16add0a862d40f4e60dfd9e602.
2019-11-20 10:12:02 -06:00
Brian M. Carlson
c10a96c54d Bump version v7.13.0 2019-11-19 10:44:31 -06:00
Brian M. Carlson
eac3e4dcaf Update changelog 2019-11-19 10:44:23 -06:00
Jim Geurts
bf029c8270 Support additional tls.connect() options (#1996)
* Support additional tls.connect() options

* Pass-through all ssl options to tls.connect()

* Fix lint error

* Remove tls.checkServerIdentity explicit option
2019-11-19 10:10:19 -06:00
Brian C
ced31dd911
Update SPONSORS.md 2019-11-19 10:10:09 -06:00
dependabot[bot]
c8c41c5b65 Bump lodash from 4.17.11 to 4.17.13 (#136)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.13.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.13)

Signed-off-by: dependabot[bot] <support@github.com>
2019-11-19 10:02:08 -06:00
Justin Merz
06fbe19923 Skip TLS SNI if host is IP address (#1890)
* skip TLS SNI if host is IP address (do not set servername option in tls.connect)

* Format code
2019-11-11 15:18:52 -03:00
Sehrope Sarkuni
cd66c0b261 Add explicit files list to package.json (#1951) 2019-11-11 15:11:24 -03:00
Charmander
caa6517999 Fix disconnection tests for pg-pool 2.0.7 (#1946)
* Require latest pg-pool ^2.0.7

to limit variability of next pg’s installations.

* Ignore EPIPE when writing termination message

I don’t know why this wasn’t necessary for tests to pass before…

* Fix disconnection tests for pg-pool 2.0.7

In pg-pool 2.0.7, checked-out clients became responsible for their own 'error' events.

brianc/node-pg-pool#123
2019-11-11 15:10:18 -03:00
Brian M. Carlson
9ced05e8aa Bump version 2019-10-30 14:08:45 -05:00
Brian C
08072a90b8
Pass options to cursor (#65)
* Bump version of pg-cursor

This includes fixes in pg-cursor@2.0.1.  I've relaxed semver a touch so I don't have to release a new version here just for patch changes to pg-cursor.

* Pass options to pg-cursor

fixes #55
2019-10-30 14:08:11 -05:00
dependabot[bot]
05b4c573d2 Bump eslint from 4.4.0 to 4.18.2 (#63)
Bumps [eslint](https://github.com/eslint/eslint) from 4.4.0 to 4.18.2.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v4.4.0...v4.18.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-10-30 13:03:26 -05:00
Brian C
3e59f28df4
Bump version of pg-cursor (#64)
This includes fixes in pg-cursor@2.0.1.  I've relaxed semver a touch so I don't have to release a new version here just for patch changes to pg-cursor.
2019-10-30 13:03:09 -05:00
Brian M. Carlson
37906091e1 Bump version 2019-10-30 12:55:38 -05:00
Brian C
5055b3a244
Merge pull request #58 from brianc/bmc/add-test-and-deprecate-method
Add additional pool test & deprecate .end
2019-10-30 12:55:02 -05:00
Brian M. Carlson
cedce4bded Fix lint & enable all tests 2019-10-30 12:52:06 -05:00
Brian M. Carlson
507c7eaca4 Merge branch 'master' into bmc/add-test-and-deprecate-method 2019-10-30 12:47:14 -05:00
Brian C
d0e67a93ff
Merge pull request #59 from brianc/bmc/fix-named-portal
Fix named portal not closing
2019-10-30 12:46:13 -05:00
Brian M. Carlson
bd86514c72 Add another test 2019-10-30 11:43:17 -05:00
Brian M. Carlson
389d5d8c14 Fix named portal being left open
When code was added to use a random named portal instead of the empty portal to support redshift we didn't update the close messages approprately.  This could result in postgres keeping locks on tables for modification if streaming and table modification was both done within a transaction.  This update fixes the issue by always issuing a close command on the named portal when query is finished.

fixes #56
2019-10-30 11:33:52 -05:00
Brian C
a84db5ffd7
Add async iterator tests (#62) 2019-10-28 12:46:49 -05:00
dependabot[bot]
a756ee30e4 Bump debug from 2.6.8 to 2.6.9 (#61)
Bumps [debug](https://github.com/visionmedia/debug) from 2.6.8 to 2.6.9.
- [Release notes](https://github.com/visionmedia/debug/releases)
- [Changelog](https://github.com/visionmedia/debug/blob/2.6.9/CHANGELOG.md)
- [Commits](https://github.com/visionmedia/debug/compare/2.6.8...2.6.9)

Signed-off-by: dependabot[bot] <support@github.com>
2019-10-28 12:10:49 -05:00
dependabot[bot]
fb52c52304 Bump js-yaml from 3.9.1 to 3.13.1 (#60)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.9.1 to 3.13.1.
- [Release notes](https://github.com/nodeca/js-yaml/releases)
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.9.1...3.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2019-10-28 12:02:44 -05:00
Mandy Real
e153e3f5fd fixed typo cumbersom (#49) 2019-10-28 12:00:09 -05:00
Brian C
c95a650a73
Upgrade dependencies (#59)
* Upgrade dependencies

- There was a security vuln with mocha, so upgraded mocha.
- Upgraded versions of node we're going to check in travis
- Switched to yarn from npm
- Removed --no-exit as that's standard mocha behavior now

* Enable postgres on newer version of travis
2019-10-28 11:58:35 -05:00
Brian M. Carlson
d3aee3dfc8 Add additional pool test & deprecate .end
There are no tests covering cursor.end().  It's also a weird method to have on the cursor as it terminates the connection to postgres internally.  I don't recall why I added this method in the first place but its not correct to close a connection to postgres by calling .end on a cursor...seems like a pretty big footgun.  If you have a pooled client and you call `cursor.end` it'll close the client internally and likely confuse the pool.  Plus it's just weird to be able to close a connection by calling .end on a query or cursor.  So...I'm deprecating that method.
2019-10-28 11:45:20 -05:00
Brian C
ff09b3f21d
Merge branch 'master' into fix-closing-finished-connections 2019-10-25 18:19:19 -05:00
Brian C
6d47026083
Merge pull request #57 from brianc/bmc/lint-changes
Fix for pg@7.x
2019-10-25 18:17:44 -05:00
Brian M. Carlson
be0321299b Update lint, fix for pg@7.x 2019-10-25 18:11:53 -05:00
Brian M. Carlson
4164686c4b meh 2019-10-25 18:03:07 -05:00
Brian M. Carlson
414fac6a05 Apply prettier to code, change lint rules 2019-10-25 12:14:27 -05:00
Ravi van Rooijen
fde5ec586e Use arrow character in readme 2019-10-13 19:53:56 -07:00
Yuri Astrakhan
2d2a87392c Minor cleanup - inline throwOnRelease() (#129)
The throwOnRelease() function does not appear to be exposed anywhere,
and it does not appear to make any sense to have it as a standalone func,
as it ovecomplicates things and makes function call as non-returning.  Inlined it.
2019-09-03 22:45:45 -07:00
Brian M. Carlson
60d8df659c Bump version v7.12.1 2019-08-09 16:02:25 -05:00
Vitaly Tomilov
05d20a6a6d Update package.json (#1937)
Fixes #1936
2019-08-09 16:00:47 -05:00
Brian M. Carlson
e4578d2c7b Bump version v7.12.0 2019-07-25 13:07:00 -05:00
Brian M. Carlson
d44376ad06 Update sponsors file 2019-07-25 13:06:51 -05:00
Brian M. Carlson
94ad322eb9 Update changelog 2019-07-25 13:06:23 -05:00
Sehrope Sarkuni
3ead900349 Fix eslint and add back standard (#1928)
* lint: Enable standard rules again

* lint: Replace hasOwnProperty(...) call

* lint: Remove trailing spaces

* lint: Remove spaces within array brackets

* lint: Disable quote-props to silence linter

* lint: Skip linting on older node versions
2019-07-25 13:00:14 -05:00
Sehrope Sarkuni
0894a3ce07 feat: Add dynamic retrieval for client password (#1926)
* feat: Add dynamic retrieval for client password

Adds option to specify a function for a client password. When the client
is connected, if the value of password is a function then it is invoked
to get the password to use for that connection.

The function must return either a string or a Promise that resolves to
a string. If the function throws or rejects with an error then it will
be bubbled up to the client.

* test: Add testAsync() helper to Suite

Add testAsync() helper function to Suite to simplify running tests that
return a Promise. The test action is executed and if a syncronous error
is thrown then it is immediately considered failed. If the Promise resolves
successfully then the test is considered successful. If the Promise
rejects with an Error then the test is considered failed.

* test: Add tests for dynamic password

* test: Simplify testAsync error handling

* fix: Clean up dynamic password error handling and misc style

* test: Remove extra semicolons

* test: Change testAsync(...) calls to use arrow functions

* fix: Wrap self.password() invocation in an arrow function

* test: Add a comment to testAsync(...)
2019-07-25 12:48:48 -05:00
Jonathan Baudanza
70d5c09958 Remove reference to "min" config option (#126)
Because it no longer exists.
2019-07-25 12:41:28 -05:00
Brian M. Carlson
e59a7667ff Bump version 2019-07-25 12:39:44 -05:00
Johannes Würbach
f9fc232db3 Remove idleListener when client is in-use (#123)
* Prevent double release with callback

When using the callback instead of client.release, double releasing
a client was possible causing clients to be re-added multiple times.

* Remove idleListener when client is in-use

When a client is in-use, the error handling should be done by the
consumer and not by the pool itself as this otherwise might cause
errors to be handled multiple times.

* Handle verify failures
2019-07-25 12:38:21 -05:00
Brian C
0acaf9d8ff
Fix compare (#1923)
* Fix deepEqual compare

In node 12 assert.deepEqual against a buffer & array no longer passes if the values are the same.  This makes sense.  Updated the test to not use deepEqual in this case.
2019-07-16 18:41:54 -05:00
darkgl0w
d8a0e1e950 Update CI to allow tests to pass on Node.js >= 10.16.0 (#1912)
* Add CI build environment scripts

* Update Travis configuration

* Don't publish CI scripts to npm

* Add Node.js 12 to CI matrix
2019-07-16 14:14:41 -05:00