Skip to content
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

Setting max: undefined results in only 1 connection being created #833

Open
kieranm opened this issue Mar 21, 2024 · 0 comments
Open

Setting max: undefined results in only 1 connection being created #833

kieranm opened this issue Mar 21, 2024 · 0 comments

Comments

@kieranm
Copy link

kieranm commented Mar 21, 2024

In our code we had an issue where we passed max: undefined when creating a Postgres instance, expecting that it would fall back to the default 10.

However, the undefined value seems to overwrite the default max: 10 due to this line:
https://github.com/porsager/postgres/blob/master/src/index.js#L472

Then, due to this line, the array resolves to [undefined] and therefore only a single connection will be created.
https://github.com/porsager/postgres/blob/master/src/index.js#L65

If max: undefined is passed then perhaps the default 10 needs to take precedence.

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

No branches or pull requests

1 participant