PoolConfiguration
Extends ConnectionConfiguration and lightning-pool's PoolConfiguration.
| Key | Type | Default | Description |
|---|---|---|---|
| pipelineMaxQueries | number | 100 | How many of Pool.query()'s one-shot queries may share a single pooled connection at the same time. PostgreSQL correlates responses to requests by order, so several queries can be in flight on one connection at once, each with its own Sync and therefore its own error boundary — max then becomes a ceiling on connections rather than on concurrent queries. Set to 1 for the older behaviour, where Pool.query() holds a connection exclusively for the duration of each query. Connections handed out by acquire() are never shared, whatever this is set to, so transactions, cursors and prepared statements are unaffected |
| pipelineMaxConnections | number | the pool's own max | How many pooled connections the pipelined path may borrow at once. Borrowed connections are handed straight back the moment they go idle, so this is a ceiling on how wide a single burst may fan out, not a reservation — lower it to keep connections free for acquire() while a burst is running |
| acquireMaxRetries | number | 0 | Maximum number that Pool will try to create a connection before returning the error |
| acquireRetryWait | number | 2000 | Time in millis that Pool will wait after each try |
| acquireTimeoutMillis | number | 0 | Time in millis an acquire call will wait for a connection before timing out |
| fifo | boolean | true | Specifies whether resources are allocated in first-in-first-out order |
| idleTimeoutMillis | number | 30000 | The minimum amount of time in millis that a connection may sit idle in the Pool |
| houseKeepInterval | number | 1000 | Time period in millis that Pool will make a cleanup |
| min | number | 0 | Minimum number of connections that Pool will keep |
| minIdle | number | 0 | Minimum number of connections that Pool will keep in idle state |
| max | number | 10 | Maximum number of connections that Pool will create |
| maxQueue | number | 1000 | Maximum number of requests that Pool will accept |
| validation | boolean | true | If true, Pool tests the connection on acquire |
See the Connection Pooling guide for usage.