From: Daniele Varrazzo Date: Sat, 21 Aug 2021 13:42:18 +0000 (+0200) Subject: Document that the connection pool is in a separate package X-Git-Tag: 3.0.dev2~4^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b07bfbdf2a70ae52eb6280ae08e803278a3ca331;p=thirdparty%2Fpsycopg.git Document that the connection pool is in a separate package --- diff --git a/docs/advanced/pool.rst b/docs/advanced/pool.rst index ed232ac14..7d4ce441b 100644 --- a/docs/advanced/pool.rst +++ b/docs/advanced/pool.rst @@ -16,6 +16,11 @@ This page explains a few basic concepts of Psycopg connection pool's behaviour. Please refer to the `ConnectionPool` object API for details about the pool operations. +.. note:: The connection pool objects are distributed in a package separate + from the main `psycopg` package: use ``pip install psycopg[pool]`` or ``pip + install psycopg_pool`` to make the `psycopg_pool` package available. See + :ref:`pool-installation`. + Pool life cycle --------------- @@ -27,6 +32,8 @@ however, and not the necessary one; in particular the connection pool acts as a context manager and can be closed automatically at the end of its ``with`` block:: + from psycopg_pool import ConnectionPool + with ConnectionPool(conninfo, **kwargs) as my_pool: run_app(my_pool) diff --git a/docs/api/pool.rst b/docs/api/pool.rst index 5b1483ee7..08eafea8a 100644 --- a/docs/api/pool.rst +++ b/docs/api/pool.rst @@ -1,5 +1,5 @@ -`pool` -- Connection pool implementations -========================================= +`!psycopg_pool` -- Connection pool implementations +================================================== .. index:: double: Connection; Pool @@ -22,6 +22,10 @@ a global object exposed by a module in your application, and use the same instance from the rest of the code (especially the `~ConnectionPool.connection()` method. +.. note:: The `!psycopg_pool` package is distributed separately from the main + `psycopg` package: use ``pip install psycopg[pool]`` or ``pip install + psycopg_pool`` to make it available. See :ref:`pool-installation`. + The `!ConnectionPool` class --------------------------- diff --git a/docs/basic/install.rst b/docs/basic/install.rst index 6e13c4164..a6f6ef1c3 100644 --- a/docs/basic/install.rst +++ b/docs/basic/install.rst @@ -141,6 +141,20 @@ If you are not able to fulfill this requirement please follow the `binary installation`_. +.. _pool-installation: + +Installing the connection pool +------------------------------ + +The :ref:`Psycopg connection pools ` are distributed in a +separate package from the `!psycopg` package itself, in order to allow a +different release cycle. + +In order to use the pool you must install the ``pool`` extra, using ``pip +install psycopg[pool]``, or install the `psycopg_pool` package separately, +which would allow to specify the release to install more precisely. + + Handling dependencies ---------------------