Skip to main content

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;
}
FieldTypeDefault as applied by SqbClientDescription
acquireMaxRetriesnumber0Retries for creating a resource after a failed create(), before an acquire() call gives up.
acquireRetryWaitnumber2000Milliseconds between acquire retries.
acquireTimeoutMillisnumber0Milliseconds to wait for a resource before acquire() rejects. 0 waits indefinitely.
idleTimeoutMillisnumber30000Milliseconds an idle connection may sit in the pool before being destroyed.
maxnumber10Maximum number of connections.
maxQueuenumber1000Maximum number of queued acquire() calls once the pool is at max.
minnumber0Minimum number of connections the pool tries to keep open.
minIdlenumber0Minimum number of idle connections the pool tries to keep open.
validationbooleanfalseWhether to call the adapter connection's test() before handing it out.
fifoboolean(not forwarded by SqbClient — see note below)Whether queued acquire() calls are served first-in-first-out.
houseKeepIntervalnumber(not forwarded by SqbClient — see note below)Milliseconds between housekeeper ticks (which enforce idleTimeoutMillis/minIdle).
note

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 trueSqbClient explicitly overrides that down to false when you don't specify it.