postgres icon indicating copy to clipboard operation
postgres copied to clipboard

Setting max: undefined results in only 1 connection being created

Open kieranm opened this issue 11 months ago • 0 comments

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.

kieranm avatar Mar 21 '24 14:03 kieranm