postgres
postgres copied to clipboard
Setting max: undefined results in only 1 connection being created
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.