Skip to content
masterclass Buddy

Neon · Method

pool.connect

Use Neon's pooled endpoint and keep each container's local pool small. Create the pool globally so warm serverless invocations can reuse it without causing connection exhaustion.

Last updated

Syntax

const pool = new Pool({ connectionString, max: 1|2, idleTimeoutMillis: 5000 });
const client = await pool.connect();
client.release();

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • @neondatabase/serverless
  • @vercel/functions
  • PgBouncer
  • default_pool_size
  • max_connections
  • query_wait_timeout
  • HTTP
  • WebSocket

Source: Using Neon from highly elastic serverless platforms. Checked 2026-11-03.