postgrelize / ConnectionPool
Interface: ConnectionPool ​
Defined in: src/connection/connection-types.ts:57
sequelize.connectionManager.pool: PoolCounters of the whole instance. With replication configured the counters are the sums over the writer pool and every replica pool (v6 has no totals there, it has a separate read and write pool), and read / write give the counters of each side. read sums all replicas. Without replication read and write are undefined.
Example ​
const { write, read } = sequelize.connectionManager.pool;
console.log(write?.using, read?.using);Extends ​
Properties ​
available ​
readonlyavailable:number
Defined in: src/connection/connection-types.ts:35
Idle connections ready to be handed out (idleCount).
Inherited from ​
maxSize ​
readonlymaxSize:number
Defined in: src/connection/connection-types.ts:41
Configured pool.max (the pg default of 10 when unset).
Inherited from ​
read ​
readonlyread:PoolCounters|undefined
Defined in: src/connection/connection-types.ts:61
Counters of all read replica pools together; only with replication.
size ​
readonlysize:number
Defined in: src/connection/connection-types.ts:33
Open connections, idle and checked out (totalCount of the pg pool).
Inherited from ​
using ​
readonlyusing:number
Defined in: src/connection/connection-types.ts:37
Checked out connections: size - available.
Inherited from ​
waiting ​
readonlywaiting:number
Defined in: src/connection/connection-types.ts:39
Acquisitions waiting for a free connection (waitingCount).
Inherited from ​
write ​
readonlywrite:PoolCounters|undefined
Defined in: src/connection/connection-types.ts:59
Counters of the writer pool; only with replication.