]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Document pgconn, pgresult properties
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 25 Aug 2021 02:58:24 +0000 (04:58 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 25 Aug 2021 02:58:24 +0000 (04:58 +0200)
docs/api/connections.rst
docs/api/cursors.rst
psycopg/psycopg/connection.py

index a8bdf11ded56ffc1a0ad8c29e17f4f567f85f3b7..b0da85abaf70b35fc9c245a01c096db00d02188b 100644 (file)
@@ -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
 ----------------------------
index e61857dc3bb312e7ab00ad55a5dce18fb88b7360..bebdd5aafa8136d74caad686f96f9ee4fe040f7f 100644 (file)
@@ -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
index 3af4ddb1af36c845bcd2dfe0d1edde6fedc8d07b..a362b50622e9883331a366890ebd429e77bee836 100644 (file)
@@ -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] = []