]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
docs(crdb): docs refinements
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 5 Jul 2022 12:17:17 +0000 (13:17 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 12 Jul 2022 11:58:34 +0000 (12:58 +0100)
docs/api/crdb.rst
psycopg/psycopg/crdb/connection.py

index bda619bd9fa7b007f8067f9d391ec9a8c3d787a4..3bc781fcc2875b4244963b3ffe51e448e75053b3 100644 (file)
@@ -69,6 +69,11 @@ CockroachDB-specific objects
 
     `psycopg.Connection` subclass.
 
+    .. automethod:: is_crdb
+
+        :param conn: the connection to check
+        :type conn: `~psycopg.Connection`, `~psycopg.AsyncConnection`, `~psycopg.pq.PGconn`
+
 
 .. autoclass:: AsyncCrdbConnection
 
@@ -77,11 +82,10 @@ CockroachDB-specific objects
 
 .. autoclass:: CrdbConnectionInfo
 
-    The object is returned by the `!info` attribute of `CrdbConnection` and
-    `AsyncCrdbConnection`.
+    The object is returned by the `~psycopg.Connection.info` attribute of
+    `CrdbConnection` and `AsyncCrdbConnection`.
 
-    The object behaves like the `!ConnectionInfo`, with the following
-    differences:
+    The object behaves like `!ConnectionInfo`, with the following differences:
 
     .. autoattribute:: vendor
 
@@ -89,10 +93,6 @@ CockroachDB-specific objects
 
     .. autoattribute:: server_version
 
-    .. attribute:: backend_pid
-
-        Always 0 as not reported by CockroachDB.
-
 
 .. data:: adapters
 
index bde15fa173fa53580da2cc017a868aae38268507..8f88365e8070a7e62b220cc0b7bdf9a20e506504 100644 (file)
@@ -32,7 +32,7 @@ class _CrdbConnectionMixin:
         cls, conn: Union[Connection[Any], AsyncConnection[Any], "PGconn"]
     ) -> bool:
         """
-        Return True if the server connected to ``conn`` is CockroachDB.
+        Return `!True` if the server connected to ``conn`` is CockroachDB.
         """
         if isinstance(conn, (Connection, AsyncConnection)):
             conn = conn.pgconn
@@ -151,7 +151,7 @@ class AsyncCrdbConnection(_CrdbConnectionMixin, AsyncConnection[Row]):
 
 class CrdbConnectionInfo(ConnectionInfo):
     """
-    `~psycopg.ConnectionInfo` subclass to get specific info on a CockroachDB database.
+    `~psycopg.ConnectionInfo` subclass to get info about a CockroachDB database.
     """
 
     __module__ = "psycopg.crdb"
@@ -165,7 +165,7 @@ class CrdbConnectionInfo(ConnectionInfo):
         """
         Return the CockroachDB server version connected.
 
-        Return a number in the PostgreSQL format (e.g. 21.2.10 -> 210210)
+        Return a number in the PostgreSQL format (e.g. 21.2.10 -> 210210).
         """
         sver = self.parameter_status("crdb_version")
         if not sver: