2777 Commits

Author SHA1 Message Date
Brian M. Carlson
1864910778 Add test for no-verify string config option 2020-05-05 11:08:05 -05:00
Brian M. Carlson
e9073f5a00 Cleanup & comments 2020-05-05 11:03:29 -05:00
Brian M. Carlson
b89eb0f81d Write tests & unify treatment of no-verify 2020-05-05 10:58:34 -05:00
Brian M. Carlson
d8c7005115 Merge branch 'bhsj/noverify' of https://github.com/benhjames/node-postgres into benhjames-bhsj/noverify 2020-05-05 10:35:46 -05:00
Brian C
88da148b18
Merge pull request #2196 from brianc/bmc/use-monorepo-connection-string
Use monorepo connection string
2020-05-05 10:31:04 -05:00
Brian C
db6a023bec
Merge pull request #2197 from brianc/bmc/fix-bad-require
Fix relative  path import
2020-05-05 10:30:32 -05:00
Brian M. Carlson
9e11004e8a No need to import from dist 2020-05-05 09:53:56 -05:00
Brian M. Carlson
3a2af0f52c Fix relative path import
Closes #2188
2020-05-05 09:50:53 -05:00
Brian M. Carlson
698993ec6d Use monorepo connection string 2020-05-05 09:43:31 -05:00
Brian C
77e45c989f
Merge pull request #2194 from papandreou/fix/monorepoRepoLinks
Fix repository field in package.json files after packages were moved into monorepo
2020-05-05 09:37:03 -05:00
Ben Salili-James
6937a2428b Add PGSSLMODE=noverify support to opt-out of rejecting self-signed certs 2020-05-05 13:24:11 +01:00
Andreas Lind
abb1f34020 Fix repository field in package.json 2020-05-05 09:26:42 +02:00
Brian M. Carlson
afd14cb5f9 Publish
- pg-connection-string@2.2.1
pg-connection-string@2.2.1
2020-04-28 21:56:25 -05:00
Brian C
e93ecacbac
Merge pull request #2184 from brianc/bmc/pg-connection-string
Include pg-connection-string into monorepo
2020-04-28 21:55:06 -05:00
Brian M. Carlson
ddf81128ab Check for the correct binary 2020-04-28 10:20:22 -05:00
Brian M. Carlson
16344cbfcd Update test command for travis
I think the new syntax I'm using here is compatible with `sh`...let's see.
2020-04-28 10:07:12 -05:00
Brian M. Carlson
3a831fc77c Run lint --fix 2020-04-28 10:02:38 -05:00
Brian M. Carlson
4aff01ef8f Add 'packages/pg-connection-string/' from commit '5233b3e77e396a368130709e762fca836290a528'
git-subtree-dir: packages/pg-connection-string
git-subtree-mainline: 35328807e3612cb267bee86dccb2551ad186624a
git-subtree-split: 5233b3e77e396a368130709e762fca836290a528
2020-04-28 09:50:40 -05:00
Brian M. Carlson
35328807e3 Publish
- pg-cursor@2.1.10
 - pg-pool@3.1.1
 - pg-protocol@1.2.2
 - pg-query-stream@3.0.7
 - pg@8.0.3
pg-cursor@2.1.10 pg-pool@3.1.1 pg-protocol@1.2.2 pg-query-stream@3.0.7 pg@8.0.3
2020-04-22 11:04:51 -05:00
Brian M. Carlson
a86cb90043 lockfile 2020-04-22 11:04:14 -05:00
Brian C
932c89ded7
Merge pull request #2171 from charmander/no-readystate
Replace uses of private/undocumented `readyState` API
2020-04-22 10:58:46 -05:00
Charmander
c8fb4168d4 Add Node 14 to CI 2020-04-21 23:23:52 -07:00
Charmander
149f482324 Replace uses of private/undocumented readyState API
The `readyState` of a newly-created `net.Socket` changed from `'closed'` to `'open'` in Node 14.0.0, so this makes the JS driver work on Node 14.

`Connection` now always calls `connect` on its `stream` when `connect` is called on it.
2020-04-21 23:20:48 -07:00
Brian C
0729130c57
Merge pull request #2164 from johan13/mem-leak
Refactor pg-pool to avoid potential memory leak
2020-04-21 17:10:50 -05:00
Johan Levin
7de8b49ad7 Refactor pg-pool to avoid potential memory leak
Reduce the closure scope captured by the "release once" lambda function
in _acquireClient so that it does not retain the pendingItem promise.
2020-04-15 11:46:15 +02:00
Brian C
2ef5550373
Merge pull request #2161 from brianc/bmc/lint
Prettier the codebase
2020-04-10 12:32:17 -05:00
Brian M. Carlson
3d9678e2e9 Remove packages from linting themselves in ci as its done at the 'top level' 2020-04-10 12:09:16 -05:00
Brian M. Carlson
12049b7dbc Actually run lint in ci 2020-04-10 11:33:46 -05:00
Brian M. Carlson
8591d94fcc Re-upgrade to prettier@2.x 2020-04-10 11:31:03 -05:00
Brian M. Carlson
6353affeca Downgrade to prettier@1.x to support node@8.x 2020-04-10 11:15:42 -05:00
Brian M. Carlson
c13cf81ee8 Lint pg & turn off semicolons 2020-04-10 10:47:57 -05:00
Brian M. Carlson
6adbcabf50 lint pg-protcol 2020-04-10 10:43:54 -05:00
Brian M. Carlson
cb928ded2a Prettier pg-query-stream 2020-04-10 10:34:34 -05:00
Brian M. Carlson
3002d5cbdd Auto-fix pg-cursor 2020-04-10 10:29:54 -05:00
Brian M. Carlson
a8471aa54b Set up prettier in workspace dir 2020-04-10 10:29:13 -05:00
Brian M. Carlson
41c899c5a2 Update changelog 2020-04-09 15:19:53 -05:00
Brian M. Carlson
da03b3f905 Publish
- pg-cursor@2.1.9
 - pg-pool@3.1.0
 - pg-protocol@1.2.1
 - pg-query-stream@3.0.6
 - pg@8.0.2
pg-cursor@2.1.9 pg-pool@3.1.0 pg-protocol@1.2.1 pg-query-stream@3.0.6 pg@8.0.2
2020-04-09 15:17:54 -05:00
Brian C
0399fe5f83
Merge pull request #2157 from chriskchew/ckc/maxuses2
Add maxUses config option to Pool
2020-04-09 14:59:48 -05:00
Brian C
ae5dae4fa4
Make several small speed tweaks for binary reading & writing (#2158) 2020-04-09 14:58:48 -05:00
Chris Chew
de81f71417 Added maxUses config option to Pool; Dev setup instructions in main README 2020-04-09 14:08:11 -05:00
Brian M. Carlson
0a90e018cd Publish
- pg-cursor@2.1.8
 - pg-protocol@1.2.0
 - pg-query-stream@3.0.5
 - pg@8.0.1
pg-cursor@2.1.8 pg-protocol@1.2.0 pg-query-stream@3.0.5 pg@8.0.1
2020-04-09 13:22:14 -05:00
Brian C
3ff91eaa32
Decouple serializing messages w/ writing them to socket (#2155)
* Move message writing to typescript lib

* Write more tests, cleanup code to some extent

* Rename package to something more representing its name

* Remove unused code

* Small tweaks based on microbenchmarks

* Rename w/o underscore
2020-04-09 12:28:19 -05:00
Brian C
2013d77b28
Parser speed improvements (#2151)
* Change from transform stream

* Yeah a thing

* Make tests pass, add new code to travis

* Update 'best' benchmarks and include tsc in pretest script

* Need to add build early so we can create test tables

* logging
2020-04-02 16:48:22 -05:00
Brian M. Carlson
90c6d1390e Update changelog
closes #2150
2020-04-01 09:15:54 -05:00
Brian M. Carlson
a227d3e8d4 Publish
- pg-cursor@2.1.7
 - pg-pool@3.0.0
 - pg-query-stream@3.0.4
 - pg@8.0.0
pg-cursor@2.1.7 pg-pool@3.0.0 pg-query-stream@3.0.4 pg@8.0.0
2020-03-30 10:45:12 -05:00
Brian C
aafd8ac64e
8.0 Release (#2117)
* Drop support for EOL versions of node (#2062)

* Drop support for EOL versions of node

* Re-add testing for node@8.x

* Revert changes to .travis.yml

* Update packages/pg-pool/package.json

Co-Authored-By: Charmander <~@charmander.me>

Co-authored-by: Charmander <~@charmander.me>

* Remove password from stringified outputs (#2066)

* Remove password from stringified outputs

Theres a security concern where if you're not careful and you include your client or pool instance in console.log or stack traces it might include the database password.  To widen the pit of success I'm making that field non-enumerable.  You can still get at it...it just wont show up "by accident" when you're logging things now.

The backwards compatiblity impact of this is very small, but it is still technically somewhat an API change so...8.0.

* Implement feedback

* Fix more whitespace the autoformatter changed

* Simplify code a bit

* Remove password from stringified outputs (#2070)

* Keep ConnectionParameters’s password property writable

`Client` writes to it when `password` is a function.

* Avoid creating password property on pool options

when it didn’t exist previously.

* Allow password option to be non-enumerable

to avoid breaking uses like `new Pool(existingPool.options)`.

* Make password property definitions consistent

in formatting and configurability.

Co-authored-by: Charmander <~@charmander.me>

* Make `native` non-enumerable (#2065)

* Make `native` non-enumerable

Making it non-enumerable means less spurious "Cannot find module"
errors in your logs when iterating over `pg` objects.

`Object.defineProperty` has been available since Node 0.12.

See https://github.com/brianc/node-postgres/issues/1894#issuecomment-543300178

* Add test for `native` enumeration

Co-authored-by: Gabe Gorelick <gabegorelick@gmail.com>

* Use class-extends to wrap Pool (#1541)

* Use class-extends to wrap Pool

* Minimize diff

* Test `BoundPool` inheritance

Co-authored-by: Charmander <~@charmander.me>
Co-authored-by: Brian C <brian.m.carlson@gmail.com>

* Continue support for creating a pg.Pool from another instance’s options (#2076)

* Add failing test for creating a `BoundPool` from another instance’s settings

* Continue support for creating a pg.Pool from another instance’s options

by dropping the requirement for the `password` property to be enumerable.

* Use user name as default database when user is non-default (#1679)

Not entirely backwards-compatible.

* Make native client password property consistent with others

i.e. configurable.

* Make notice messages not an instance of Error (#2090)

* Make notice messages not an instance of Error

Slight API cleanup to make a notice instance the same shape as it was, but not be an instance of error.  This is a backwards incompatible change though I expect the impact to be minimal.

Closes #1982

* skip notice test in travis

* Pin node@13.6 for regression in async iterators

* Check and see if node 13.8 is still borked on async iterator

* Yeah, node still has changed edge case behavior on stream

* Emit notice messages on travis

* Revert "Revert "Support additional tls.connect() options (#1996)" (#2010)" (#2113)

This reverts commit 510a273ce45fb73d0355cf384e97ea695c8a5bcc.

* Fix ssl tests (#2116)

* Convert Query to an ES6 class (#2126)

The last missing `new` deprecation warning for pg 8.

Co-authored-by: Charmander <~@charmander.me>
Co-authored-by: Gabe Gorelick <gabegorelick@gmail.com>
Co-authored-by: Natalie Wolfe <natalie@lifewanted.com>
2020-03-30 10:31:35 -05:00
dependabot[bot]
c036779d9c
Bump acorn from 7.1.0 to 7.1.1 (#2136)
Bumps [acorn](https://github.com/acornjs/acorn) from 7.1.0 to 7.1.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/7.1.0...7.1.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-03-30 10:31:04 -05:00
Herman J. Radtke III
5233b3e77e Release v2.2.0 2020-03-19 21:57:19 -07:00
Sam :D
11d7c591fa
typo fix (#2118) 2020-02-26 10:49:41 -06:00
Brian C
1c8b6b93cf
Call callback when end called on unconnected client (#2109)
* Call callback when end called on unconnected client

Closes #2108

* Revert a bit of the change

* Use readyState because pending doesn't exist in node 8.x

* Update packages/pg/lib/client.js

use bring your own promise

Co-Authored-By: Charmander <~@charmander.me>

Co-authored-by: Charmander <~@charmander.me>
2020-02-25 08:48:58 -06:00