Skip to content

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 ​

ts
const { write, read } = sequelize.connectionManager.pool;
console.log(write?.using, read?.using);

Extends ​

Properties ​

available ​

readonly available: number

Defined in: src/connection/connection-types.ts:35

Idle connections ready to be handed out (idleCount).

Inherited from ​

PoolCounters.available


maxSize ​

readonly maxSize: number

Defined in: src/connection/connection-types.ts:41

Configured pool.max (the pg default of 10 when unset).

Inherited from ​

PoolCounters.maxSize


read ​

readonly read: PoolCounters | undefined

Defined in: src/connection/connection-types.ts:61

Counters of all read replica pools together; only with replication.


size ​

readonly size: number

Defined in: src/connection/connection-types.ts:33

Open connections, idle and checked out (totalCount of the pg pool).

Inherited from ​

PoolCounters.size


using ​

readonly using: number

Defined in: src/connection/connection-types.ts:37

Checked out connections: size - available.

Inherited from ​

PoolCounters.using


waiting ​

readonly waiting: number

Defined in: src/connection/connection-types.ts:39

Acquisitions waiting for a free connection (waitingCount).

Inherited from ​

PoolCounters.waiting


write ​

readonly write: PoolCounters | undefined

Defined in: src/connection/connection-types.ts:59

Counters of the writer pool; only with replication.

Released under the MIT License.