From 66692600fb32a5fe17ecc53a7e32e015e98eff49 Mon Sep 17 00:00:00 2001 From: pr-relay Date: Sun, 16 Aug 2026 12:48:46 +0000 Subject: [PATCH] docs: clarify pooled connection lifetime --- docs/usage.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/usage.rst b/docs/usage.rst index e490a2ef..01483f35 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -411,6 +411,10 @@ To create a connection pool, use the The resulting :class:`Pool ` object can then be used to borrow connections from the pool. +When using ``async with pool.acquire() as connection``, the connection is +released back to the pool automatically when the context exits. There is no +need to close the borrowed connection explicitly. + Below is an example of how **asyncpg** can be used to implement a simple Web service that computes the requested power of two.