method

ReservedSQL.release

release(): Promise<void>;

Releases the connection back to the pool.

The client closes immediately: new queries and begin() calls reject. A transaction started with begin() on this client keeps the connection until it ends, and the pool gets the connection back after that. The returned promise resolves right away, so you can await release() inside such a transaction.

Bun closes a connection that is released inside an open transaction, for example after a manual BEGIN, instead of returning it to the pool.