psycopg.git / summary / log / commit / refs
commit b07bfbdf2a70ae52eb6280ae08e803278a3ca331
Author: Daniele Varrazzo <daniele.varrazzo@gmail.com>
Date: Sat Aug 21 13:42:18 2021 +0000
Document that the connection pool is in a separate package
docs/advanced/pool.rst | 7 +++++++
docs/api/pool.rst | 8 ++++++--
docs/basic/install.rst | 14 ++++++++++++++
3 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/docs/advanced/pool.rst b/docs/advanced/pool.rst
index ed232ac1..7d4ce441 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 5b1483ee..08eafea8 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 6e13c416..a6f6ef1c 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 <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
---------------------
[parent: 4baadf12bd0e]