{"version":1,"upstream":"MagicStack/asyncpg","fork":"aryansk/asyncpg","base":"master","branch":"docs/1316-pool-acquire-lifetime","commitMessage":"docs: clarify pooled connection lifetime","prTitle":"Clarify pooled connection lifetime","prBody":"## Summary\n\nClarify the connection-pool usage guide for readers who are new to async context managers.\n\n## Changes\n\n- state explicitly that leaving async with pool.acquire() releases the borrowed connection back to the pool\n- clarify that callers should not explicitly close that borrowed connection\n\nFixes #1316","patch":"diff --git a/docs/usage.rst b/docs/usage.rst\n--- a/docs/usage.rst\n+++ b/docs/usage.rst\n@@ -405,6 +405,10 @@ To create a connection pool, use the\n The resulting :class:Pool <asyncpg.pool.Pool> object can then be used\n to borrow connections from the pool.\n \n+When using async with pool.acquire() as connection, the connection is\n+released back to the pool automatically when the context exits. There is no\n+need to close the borrowed connection explicitly.\n+\n Below is an example of how asyncpg can be used to implement a simple\n Web service that computes the requested power of two.\n","draft":true,"upstreamIssue":1316}
{"version":1,"upstream":"MagicStack/asyncpg","fork":"aryansk/asyncpg","base":"master","branch":"docs/1316-pool-acquire-lifetime","commitMessage":"docs: clarify pooled connection lifetime","prTitle":"Clarify pooled connection lifetime","prBody":"## Summary\n\nClarify the connection-pool usage guide for readers who are new to async context managers.\n\n## Changes\n\n- state explicitly that leaving
async with pool.acquire()releases the borrowed connection back to the pool\n- clarify that callers should not explicitly close that borrowed connection\n\nFixes #1316","patch":"diff --git a/docs/usage.rst b/docs/usage.rst\n--- a/docs/usage.rst\n+++ b/docs/usage.rst\n@@ -405,6 +405,10 @@ To create a connection pool, use the\n The resulting :class:Pool <asyncpg.pool.Pool>object can then be used\n to borrow connections from the pool.\n \n+When usingasync with pool.acquire() as connection, the connection is\n+released back to the pool automatically when the context exits. There is no\n+need to close the borrowed connection explicitly.\n+\n Below is an example of how asyncpg can be used to implement a simple\n Web service that computes the requested power of two.\n","draft":true,"upstreamIssue":1316}