Alexandro.Net

PostgreSQL connection pool / MIT

@stackline/pg-pool

A maintained, dependency-free continuation of [email protected] for long-lived PostgreSQL connection pooling.

npm install @stackline/pg-pool

Keep existing imports with npm install pg-pool@npm:@stackline/pg-pool.

Release
1.0.0
Runtime
Node 16+
Formats
CommonJS + ESM
Dependencies
0
Baseline
pg-pool 3.14.0

01 / Quick start

Pool a compatible Client constructor.

const Pool = require('@stackline/pg-pool')
const { Client } = require('@stackline/pg')

const pool = new Pool({ Client, max: 20 })
const result = await pool.query('select now()')
await pool.end()

02 / Pool lifecycle

Acquire, use, release, and shut down predictably.

Long-lived pools. Create one pool for an application process and reuse it. Size, idle, connection, lifetime, and maximum-use limits remain configurable.

Transactions. Check out one client for the complete transaction and release it in a finally block.

Shutdown. pool.end() drains idle resources and preserves the callback and promise forms of the upstream API.

03 / Dependency boundary

No driver is silently installed.

04 / Migration

Preserve the package key or make provenance explicit.

Historical key

npm install pg-pool@npm:@stackline/pg-pool

Existing require('pg-pool') calls continue unchanged.

Scoped key

npm install @stackline/pg-pool

Use direct scoped imports in new applications.

05 / Reference

Read the maintained contract.