72 Commits

Author SHA1 Message Date
Brian Carlson
abff18d6f9 Publish
- pg-connection-string@2.9.0
 - pg-cursor@2.15.0
 - pg-esm-test@1.2.0
 - pg-native@3.5.0
 - pg-pool@3.10.0
 - pg-protocol@1.10.0
 - pg-query-stream@4.10.0
 - pg@8.16.0
2025-05-12 11:49:59 -05:00
Davide Violante
93aa1ba2f1
chore: replace var with const in md files (#3446) 2025-04-28 09:54:46 +00:00
Brian C
9e7a5d97cf
Replace all usages of var with let / const - eslint auto applied (#3444) 2025-04-27 11:50:33 -05:00
Harish T
ff40638868
Support Min connection pool parameter #3009 (#3438)
* Support Min connection pool parameter #3009

* Remove extraneous change

* streamline code
2025-04-25 14:41:02 -05:00
Brian C
229de3006b
Remove circluar dep for test dependency - I think this is managed w learna and not needed (#3441)
Co-authored-by: Brian Carlson <brian.carlson@getcruise.com>
2025-04-25 14:34:31 -05:00
Brian Carlson
81d875fe09 Publish
- pg-cursor@2.14.6
 - pg-esm-test@1.1.6
 - pg-pool@3.9.6
 - pg-query-stream@4.9.6
 - pg@8.15.6
2025-04-25 14:09:08 -05:00
Brian Carlson
56e2862577 Publish
- pg-cloudflare@1.2.5
 - pg-connection-string@2.8.5
 - pg-cursor@2.14.5
 - pg-esm-test@1.1.5
 - pg-native@3.4.5
 - pg-pool@3.9.5
 - pg-protocol@1.9.5
 - pg-query-stream@4.9.5
 - pg@8.15.5
2025-04-23 13:48:25 -05:00
Brian Carlson
2919f28d31 Manually advance patch versions to re-align with lerna 2025-04-23 13:48:13 -05:00
Brian Carlson
fb25f7bdb3 Publish
- pg-connection-string@2.8.1
 - pg-cursor@2.14.1
 - pg-esm-test@1.1.1
 - pg-pool@3.9.1
 - pg-query-stream@4.9.1
 - pg@8.15.1
2025-04-22 15:27:31 -05:00
Brian Carlson
9ec9e5f58d Publish
- pg-cloudflare@1.2.0
 - pg-connection-string@2.8.0
 - pg-cursor@2.14.0
 - pg-esm-test@1.1.0
 - pg-native@3.4.0
 - pg-pool@3.9.0
 - pg-protocol@1.9.0
 - pg-query-stream@4.9.0
 - pg@8.15.0
2025-04-22 10:55:24 -05:00
Brian C
940479bc4b
Add esm exports (#3423)
* build: add esm exports

* fix: add defaults as per arethetypeswrong report

* fix: add missing types

* lint

* Fix broken tests

* Add (failing) test for esm compat

* Begin moving files to proper extension and adding tests

* Add tests for connection-string and fix cloudflare module type and esm compat

* Add query-stream and cursor as esm exports

* Update PR copilot review

* Publish

 - pg-cloudflare@1.1.2-alpha.0
 - pg-connection-string@2.7.1-alpha.0
 - pg-cursor@2.13.2-alpha.0
 - pg-esm-test@1.0.1-alpha.0
 - pg-native@3.3.1-alpha.0
 - pg-pool@3.8.1-alpha.0
 - pg-protocol@1.8.1-alpha.0
 - pg-query-stream@4.8.2-alpha.0
 - pg@8.14.2-alpha.0

* More cf compat work

* Publish

 - pg-cloudflare@1.1.2-alpha.1
 - pg-cursor@2.13.2-alpha.1
 - pg-esm-test@1.0.1-alpha.1
 - pg-pool@3.8.1-alpha.1
 - pg-query-stream@4.8.2-alpha.1
 - pg@8.14.2-alpha.1

* Add more cf compat and update tests

* Make tests pass - update exports for esm

* Use env vars for test connection in cf tests

* Fix lint

* Fit vitest into existing legacy framework

* Skip worker tests on node below 18

* Revert doc changes for now

* Remove legacy worker test in favor of vitest

---------

Co-authored-by: Luca Ban <mesqueeb@users.noreply.github.com>
2025-04-22 10:53:22 -05:00
Charmander
d8fb2f9c35
test: Avoid silencing errors from idle timeout test’s child process (#3419)
This hid the error fixed in #3263, for example.
2025-04-13 07:18:33 +00:00
Alex Anderson
9b510373a6
eslint: enable recommended ruleset (#3263) 2025-04-12 08:17:33 +00:00
Brian Carlson
f7c92e487c Publish
- pg-cursor@2.13.0
 - pg-native@3.3.0
 - pg-pool@3.8.0
 - pg-protocol@1.8.0
 - pg-query-stream@4.8.0
 - pg@8.14.0
2025-03-11 10:25:26 -05:00
francesco
1876f2000a
Add "unref" to timers (#3396)
* chore: add unref to timer

see https://nodejs.org/api/timers.html#timeoutunref

* chore: add unref to timer

see https://nodejs.org/api/timers.html#timeoutunref

* fix: lint

* fix: lint

* fix: lint

* fix: lint
2025-03-10 12:16:57 -05:00
Brian Carlson
732580782f Publish
- pg-cursor@2.12.2
 - pg-native@3.2.1
 - pg-pool@3.7.1
 - pg-protocol@1.7.1
 - pg-query-stream@4.7.2
 - pg@8.13.2
2025-02-11 10:19:52 -06:00
Andy Young
95bec690b3
fix(pg-pool): don't throw on readonly .message e.g. ErrorEvent, preserve original exception (#3374)
* fix(pg-pool): preserve original error on connection timeout, don't throw on readonly .message e.g. ErrorEvent

Fixes https://github.com/brianc/node-postgres/issues/3373

* Fix lint
2025-02-10 16:27:55 -06:00
Islam
373093d176
docs: fix pg-pool readme grammar (#3350)
[skip ci]
2024-12-08 08:14:53 +00:00
Brian Carlson
92cb640fd3 Publish
- pg-connection-string@2.7.0
 - pg-cursor@2.12.0
 - pg-native@3.2.0
 - pg-pool@3.7.0
 - pg-protocol@1.7.0
 - pg-query-stream@4.7.0
 - pg@8.13.0
2024-09-17 10:08:42 -05:00
dependabot[bot]
fb12280340
Bump bluebird from 3.4.1 to 3.7.2 (#3303)
Bumps [bluebird](https://github.com/petkaantonov/bluebird) from 3.4.1 to 3.7.2.
- [Release notes](https://github.com/petkaantonov/bluebird/releases)
- [Commits](https://github.com/petkaantonov/bluebird/compare/v3.4.1...v3.7.2)

---
updated-dependencies:
- dependency-name: bluebird
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-17 09:31:21 -05:00
dependabot[bot]
54eb0fa216
Bump mocha and @types/mocha (#3273)
Bumps [mocha](https://github.com/mochajs/mocha) and [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha). These dependencies needed to be updated together.

Updates `mocha` from 3.4.2 to 10.5.2
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v3.4.2...v10.5.2)

Updates `@types/mocha` from 5.2.7 to 10.0.7
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-major
- dependency-name: "@types/mocha"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 12:20:59 -05:00
Alex Anderson
1625861981
Remove unused imports (#3241)
* Remove unused imports

* reinstate test helper

---------

Co-authored-by: alxndrsn <alxndrsn>
2024-06-05 10:50:52 -05:00
Brian Carlson
b03c071d2d Publish
- pg-connection-string@2.6.3
 - pg-cursor@2.10.4
 - pg-pool@3.6.2
 - pg-protocol@1.6.1
 - pg-query-stream@4.5.4
 - pg@8.11.4
2024-03-30 15:40:05 -05:00
Tunçer Damat
df0f4d19fb
Correction of the "e" variable to "err" in snippet (#3123) 2024-01-10 08:22:00 -08:00
Alex Anderson
16322c2d50
Fix eslint violations (#3078)
Co-authored-by: alxndrsn <alxndrsn>
2023-10-19 10:27:25 -05:00
Brian Carlson
eaafac36dc Publish
- pg-cloudflare@1.1.1
 - pg-connection-string@2.6.1
 - pg-cursor@2.10.1
 - pg-pool@3.6.1
 - pg-query-stream@4.5.1
 - pg@8.11.1
2023-06-26 11:36:32 -05:00
phiresky
d59cd15ed2
fix stack traces of query() to include the async context (#1762) (#2983)
* fix stack traces of query() to include the async context (#1762)

* rename tests so they are actually run

* conditionally only run async stack trace tests on node 16+

* add stack trace to pg-native

---------

Co-authored-by: Charmander <~@charmander.me>
2023-05-31 11:28:53 -05:00
Brian C
0870442776
Fix race condition in release event test for pool (#2969) 2023-05-01 09:15:20 -05:00
Brian Carlson
ee302cbcf1 Publish
- pg-cursor@2.9.0
 - pg-pool@3.6.0
 - pg-query-stream@4.4.0
 - pg@8.10.0
2023-03-06 14:18:02 -06:00
Ryan B. Harvey
810b125581
Emit a 'release' event when a connection is released back to the pool (#2845) 2023-03-06 12:32:13 -06:00
Brian C
47afe5cded
Attempt to fix timing test flake on older versions of node in CI (#2902) 2023-01-23 13:55:38 -08:00
Brian Carlson
c99fb2c127 Publish
- pg-cursor@2.7.4
 - pg-pool@3.5.2
 - pg-query-stream@4.2.4
 - pg@8.8.0
2022-08-23 11:36:18 -05:00
Brian C
a4ef6ce38c
Fix error handling test (#2789)
* Fix error handling test

#2569 introduced a bug in the test. The test never passed but because travis-ci lovingly broke the integration we had a long time ago the tests weren't run in CI until I merged.  So, this fixes the tests & does a better job cleaning up the query in an errored state.

* Update sponsors
2022-08-22 19:05:59 -05:00
Alex Zlotnik
8032fbad43
Catch errors client throws in pool (#2569)
* Catch errors client throws in pool

* Add a test

This test _should be_ right
2022-08-22 15:33:51 -05:00
ChrisWritable
3ca56027d3
Immediately unref() maxLifetimeSeconds Timeout object to prevent blocking allowExitOnIdle (#2721) 2022-05-12 19:05:02 -05:00
Brian Carlson
4fa7ee891a Publish
- pg-cursor@2.7.3
 - pg-pool@3.5.1
 - pg-query-stream@4.2.3
 - pg@8.7.3
2022-02-04 10:28:01 -06:00
Brian Carlson
9a61e9ac58 Format with prettier 2022-02-04 10:27:51 -06:00
Brian Carlson
6849cc6868 Publish
- pg-cursor@2.7.2
 - pg-pool@3.5.0
 - pg-query-stream@4.2.2
 - pg@8.7.2
2022-02-04 10:21:57 -06:00
ChrisWritable
8392918d7b
Add connection lifetime limit option and tests (#2698)
Co-authored-by: ChrisG0x20 <position0x45@hotmail.com>
2022-01-28 17:17:48 -06:00
Steffen Weidenhaus
2c3adf25f9
Update README.md (#2671)
Change `name` to `now` for time column
2021-12-17 00:15:26 -06:00
Brian M. Carlson
92b4d37926 Publish
- pg-cursor@2.7.1
 - pg-pool@3.4.1
 - pg-query-stream@4.2.1
 - pg@8.7.1
2021-07-27 17:33:19 -05:00
Brian C
86d31a6fad
Only call client.ref if it exists
* Only call client.ref if it exists. Fixes #2582

* Make test requiring port less flakey

* Bump port range

Fixes #2582
Fixes #2584
2021-07-27 17:27:05 -05:00
Brian M. Carlson
f3b0ee4c09 Publish
- pg-cursor@2.7.0
 - pg-pool@3.4.0
 - pg-query-stream@4.2.0
 - pg@8.7.0
2021-07-27 12:41:17 -05:00
Brian Crowell
684cd09bce
Allow Node to exit if the pool is idle (#2568)
Based on the suggestion from #2078. This adds ref/unref methods to the
Connection and Client classes and then uses them to allow the process to
exit if all of the connections in the pool are idle. This behavior is
controlled by the allowExitOnIdle flag to the Pool constructor; it defaults
to the old behavior.
2021-07-27 11:29:07 -05:00
Greg Brown
9d2c977ce9
Use _isFull instead of duplicating clients check (#2539)
Noticed that options.max is compared against client count directly, but there's a method wrapping it. I can't see any reason to duplicate it? And using _isFull means I can override that for the adaptive pooling idea I'm exploring :)
2021-06-22 09:55:21 -05:00
Charmander
7667e7c9e7
Fix and enable pool verify option test (#2528)
by not double-releasing.

Reviewed-by: Sehrope Sarkuni <sehrope@jackdb.com>
2021-05-27 23:37:07 +00:00
Charmander
8f0db306d9
Remove broken test (#2529)
It’s missing `co.wrap`, so it doesn’t actually run (Mocha does nothing with the paused generator). The test group that follows it, “using an ended pool”, covers the same thing anyway.
2021-04-27 15:34:08 -05:00
Brian M. Carlson
d459479382 Publish
- pg-connection-string@2.5.0
 - pg-cursor@2.6.0
 - pg-pool@3.3.0
 - pg-protocol@1.5.0
 - pg-query-stream@4.1.0
 - pg@8.6.0
2021-04-13 11:02:40 -05:00
Emily Marigold Klassen
5a41a56862
Add missing metadata to package.jsons (#2487)
Co-authored-by: Emily Marigold Klassen <forivall@users.noreply.github.com>
2021-03-12 08:23:13 -06:00
Brian M. Carlson
b6d69d5bc2 Publish
- pg-cursor@2.4.2
 - pg-pool@3.2.2
 - pg-query-stream@3.3.2
 - pg@8.4.2
2020-10-26 12:19:03 -05:00