Skip to content

Add pg-pool to monorepo #2048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 98 commits into from
Dec 28, 2019
Merged

Add pg-pool to monorepo #2048

merged 98 commits into from
Dec 28, 2019

Conversation

brianc
Copy link
Owner

@brianc brianc commented Dec 27, 2019

using the git subtree approach to preserve commits. Also deleted some unused files like nested .gitignore and yarn.lock files in sub-packages which aren't used anymore.

brianc and others added 30 commits June 7, 2016 19:16
Demonstrate that pg-pool exports Pool constructor
Prevent `generic-pool` error when releasing a client with an error.

Fixes #2
Accept a `log: (message, other...) => { }` parameter as a config option, but by default use a no-op function instead of debug.
* Have pool emit 'connect' callback with client

* Ensure pool emits client on connect event
* Add travis.yml file

* Remove test on [email protected] since travis does not support it
Add travis badge
Add a section with instructions on where to instantiate your pool
* Add callback interface to pool#query

* Fix linting errors
brianc and others added 28 commits August 10, 2017 00:20
* Add connection & query timeout if all clients are checked out

This addresses [pg#1390](#1390).

Ensure connection timeout applies both for new connections and on an exhuasted pool.  I also made the library return an error when passing a function as the first param to `pool.query` - previosuly this threw a sync type error.

* Add pg-cursor to dev deps
* Add failing test for idle timer continuation after removal

* Clear idle timeout only for removed client

* Copy list of idle clients for modification during iteration
* Update CI versions

PostgreSQL 9.1 is no longer available on 14.04.

* Add Node 9 to CI
* Count only test query itself

This breaks more obviously in PostgreSQL 10 (https://wiki.postgresql.org/wiki/New_in_postgres_10#Significant_Expansion_of_Wait_Events_in_pg_stat_activity).

* Fix query counting for PostgreSQL 9.1
* Add failing test for correct removal from checkout queue on timeout

* Remove timed-out checkouts from queue correctly

Fixes #85.
Existing log code was outputting 'connecting new client' twice and saying 'new client connected', creating a false impression when an error (like a timeout) was present.
* Test queued checkout after a connection failure

Co-authored-by: Johannes Würbach <[email protected]>

* Fix queued checkout after a connection failure

Co-authored-by: Johannes Würbach <[email protected]>
* Upgrade to test on node 10

* Use errno instead of code

* Only check errno if it exists
* 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
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.
If an error not related to the query occurs, the client is emitting an
error event.

Forward this event to the callback.
…bafeaba0'

git-subtree-dir: packages/pg-pool
git-subtree-mainline: 69345eb
git-subtree-split: cb96ae2
@brianc brianc mentioned this pull request Dec 27, 2019
@brianc brianc merged commit 0b87d49 into master Dec 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.