2042 Commits

Author SHA1 Message Date
Brian M. Carlson
b14cf678cc Remove postgres 9.1 from test matrix - json is not supported 2019-12-18 14:08:23 -06:00
Brian M. Carlson
57177d749e Use public npm - accidentally had my work npm configured 2019-12-18 13:53:57 -06:00
Brian M. Carlson
5c0c93ce1d Remove nested travis file 2019-12-18 13:47:56 -06:00
Brian M. Carlson
423baa644a Update lint rules for pg-cursor 2019-12-18 13:42:47 -06:00
Brian M. Carlson
37d15740ed Add 'packages/pg-cursor/' from commit '492fbdbb65f6f33396d1017fa4cdbbb247dd3895'
git-subtree-dir: packages/pg-cursor
git-subtree-mainline: ebb81dbfa635eca73d16d54b501f04c8d843bac5
git-subtree-split: 492fbdbb65f6f33396d1017fa4cdbbb247dd3895
2019-12-18 13:20:51 -06:00
Brian M. Carlson
492fbdbb65 Merge branch 'juneidysoo-master' 2019-12-18 13:17:49 -06:00
Brian M. Carlson
e20d0128fc Merge branch 'master' of https://github.com/juneidysoo/node-pg-cursor into juneidysoo-master 2019-12-18 13:16:55 -06:00
Brian C
e34c6021ef
Merge pull request #32 from hetul/fix-closing-finished-connections
Fix closing a finished cursor without supplying a callback
2019-12-18 12:38:30 -06:00
Brian M. Carlson
ebb81dbfa6 Publish
- pg@7.15.0
pg@7.15.0
2019-12-17 10:35:38 -06:00
Brian M. Carlson
7feaafd771 Update changelog 2019-12-17 10:34:09 -06:00
Brian C
1b5f3e33c4
Monorepo (#2014)
* First crack at monorepo

* Update test command

* Update path to script

* Remove node 6 from CI
2019-12-17 08:32:08 -08:00
Charmander
2b59209cf3 Warn when functions intended as constructors are called without new (#2021)
* Warn when pg.Pool() isn’t called as a constructor

in preparation for #1541. `eval` is a bit awkward, but it’s more accurate than an `instanceof` check and will work on platforms new enough to support pg 8 (i.e. only not Node 4).

* Warn when Query() isn’t called as a constructor
2019-12-17 08:02:38 -08:00
Hetul Patel
124c89b173 fix lint issues 2019-12-13 15:30:40 -08:00
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
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
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 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
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
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
Juneidy
b0f7958299 Fix hanging listener when error occured 2019-06-27 11:55:38 +08:00