* Test queued checkout after a connection failure
Co-authored-by: Johannes Würbach <johannes.wuerbach@googlemail.com>
* Fix queued checkout after a connection failure
Co-authored-by: Johannes Würbach <johannes.wuerbach@googlemail.com>
* Add read_timeout to connection settings
* Fix uncaught error issue
* Fix lint
* Fix "queryCallback is not a function"
* Added test and fixed error returning
* Added query timeout to native client
* Added test for timeout not reached
* Ensure error is the correct one
Correct test name
* Removed dubious check
* Added new test
* Improved test
Fixes the deprecation warning for using `new Buffer`.
The change is semver major in buffer-writer since we dropped support for node < 4.x, but otherwise it's a non-breaking change. Since node-postgres already requires node >= 4.x it's fine.
* Add tests for query callbacks after connection-level errors
* Ensure callbacks are executed for all queued queries after connection-level errors
Separates socket errors from error messages, sends socket errors to all queries in the queue, marks clients as unusable after socket errors.
This is not very pleasant but should maintain backwards compatibility…?
* Always call `handleError` asynchronously
This doesn’t match the original behaviour of the type errors, but it’s correct.
* Fix return value of `Client.prototype.query` in immediate error cases
* Mark clients with closed connections as unusable consistently
* Add tests for error event when connecting Client
* Ensure the promise and callback versions of Client#connect always have the same behaviour
* Give same error to queued queries as to active query when ending
and do so in the native Client as well.
* Restore original ordering between queued query callbacks and 'end' event
Defaults to built-in `tls.checkServerIdentity` method in the event one is not passed into `pgConfig.ssl`
Found breaking in v9.4.2 vs v9.4.1 a la 49054717b4ec0c6d477f04c2becd1f9680b2d13a
cc @tobio @brianc