PoolConfiguration
PoolConfiguration (re-exported from the lightning-pool package) configures the connection
pool SqbClient builds around its adapter. Pass it as ClientConfiguration.pool. See
Connection Pooling for the full
guide, including a note on the two fields SqbClient does not forward.
interface PoolConfiguration {
acquireMaxRetries?: number;
acquireRetryWait?: number;
acquireTimeoutMillis?: number;
fifo?: boolean;
idleTimeoutMillis?: number;
houseKeepInterval?: number;
min?: number;
minIdle?: number;
max?: number;
maxQueue?: number;
validation?: boolean;
}
| Field | Type | Default as applied by SqbClient | Description |
|---|---|---|---|
acquireMaxRetries | number | 0 | Retries for creating a resource after a failed create(), before an acquire() call gives up. |
acquireRetryWait | number | 2000 | Milliseconds between acquire retries. |
acquireTimeoutMillis | number | 0 | Milliseconds to wait for a resource before acquire() rejects. 0 waits indefinitely. |
idleTimeoutMillis | number | 30000 | Milliseconds an idle connection may sit in the pool before being destroyed. |
max | number | 10 | Maximum number of connections. |
maxQueue | number | 1000 | Maximum number of queued acquire() calls once the pool is at max. |
min | number | 0 | Minimum number of connections the pool tries to keep open. |
minIdle | number | 0 | Minimum number of idle connections the pool tries to keep open. |
validation | boolean | false | Whether to call the adapter connection's test() before handing it out. |
fifo | boolean | (not forwarded by SqbClient — see note below) | Whether queued acquire() calls are served first-in-first-out. |
houseKeepInterval | number | (not forwarded by SqbClient — see note below) | Milliseconds between housekeeper ticks (which enforce idleTimeoutMillis/minIdle). |
SqbClient's constructor builds a fresh pool-options object from only the nine fields listed with
a concrete default above; it never reads pool.fifo or pool.houseKeepInterval off your config.
If you set either, it is currently silently ignored, and the underlying lightning-pool pool
falls back to its own built-in defaults for those two fields (fifo: true,
houseKeepInterval: 1000). Also note that lightning-pool itself defaults validation to
true — SqbClient explicitly overrides that down to false when you don't specify it.