From: Daniele Varrazzo Date: Wed, 25 Aug 2021 02:58:24 +0000 (+0200) Subject: Document pgconn, pgresult properties X-Git-Tag: 3.0.beta1~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0142fd70cb6607acc618228b83f192fd03536ded;p=thirdparty%2Fpsycopg.git Document pgconn, pgresult properties --- diff --git a/docs/api/connections.rst b/docs/api/connections.rst index a8bdf11de..b0da85aba 100644 --- a/docs/api/connections.rst +++ b/docs/api/connections.rst @@ -205,6 +205,15 @@ The `!Connection` class .. rubric:: Checking and configuring the connection state + .. autoattribute:: pgconn + + The `~pq.PGconn` libpq connection wrapper underlying the `!Connection`. + + It can be used to send low level commands to PostgreSQL and access to + features not currently wrapped by Psycopg. + + .. autoattribute:: info + .. autoattribute:: client_encoding The property is writable for sync connections, read-only for async @@ -237,10 +246,6 @@ The `!Connection` class .. __: https://www.postgresql.org/docs/current/multibyte.html - .. autoattribute:: info - - .. automethod:: fileno - .. autoattribute:: prepare_threshold See :ref:`prepared-statements` for details. @@ -278,6 +283,8 @@ The `!Connection` class .. automethod:: remove_notice_handler + .. automethod:: fileno + The `!AsyncConnection` class ---------------------------- diff --git a/docs/api/cursors.rst b/docs/api/cursors.rst index e61857dc3..bebdd5aaf 100644 --- a/docs/api/cursors.rst +++ b/docs/api/cursors.rst @@ -180,6 +180,13 @@ The `!Cursor` class .. autoattribute:: rowcount .. autoattribute:: rownumber + .. attribute:: pgresult + + The `~pq.PGresult` object obtained by the last query. + + It can be used to obtain low level info about the last query result + and to access to features not currently wrapped by Psycopg. + .. attribute:: _query An helper object used to convert queries and parameters before sending diff --git a/psycopg/psycopg/connection.py b/psycopg/psycopg/connection.py index 3af4ddb1a..a362b5062 100644 --- a/psycopg/psycopg/connection.py +++ b/psycopg/psycopg/connection.py @@ -102,7 +102,7 @@ class BaseConnection(Generic[Row]): TransactionStatus = pq.TransactionStatus def __init__(self, pgconn: "PGconn"): - self.pgconn = pgconn # TODO: document this + self.pgconn = pgconn self._autocommit = False self._adapters = adapt.AdaptersMap(postgres.adapters) self._notice_handlers: List[NoticeHandler] = []