summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2019-02-17 02:37:09 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2019-02-17 02:37:09 +0000
commita68df50c7b198bdf021148e8fe7afe81cbf3ab73 (patch)
tree3225564ab905843d533fb19973dd9cd2215f9be3 /doc
parent0eb45607717b2f727f99f388b74f5d84f359d365 (diff)
downloadpsycopg2-a68df50c7b198bdf021148e8fe7afe81cbf3ab73.tar.gz
Added ConnectionInfo.dsn_parameters attributeinfo-dsn-params
Diffstat (limited to 'doc')
-rw-r--r--doc/src/connection.rst49
-rw-r--r--doc/src/extensions.rst9
2 files changed, 35 insertions, 23 deletions
diff --git a/doc/src/connection.rst b/doc/src/connection.rst
index 95b858d..b31c2d2 100644
--- a/doc/src/connection.rst
+++ b/doc/src/connection.rst
@@ -614,29 +614,6 @@ The ``connection`` class
.. index::
- pair: Connection; Parameters
-
- .. method:: get_dsn_parameters()
-
- Get the effective dsn parameters for the connection as a dictionary.
-
- The *password* parameter is removed from the result.
-
- Example::
-
- >>> conn.get_dsn_parameters()
- {'dbname': 'test', 'user': 'postgres', 'port': '5432', 'sslmode': 'prefer'}
-
- Requires libpq >= 9.3.
-
- .. seealso:: libpq docs for `PQconninfo()`__ for details.
-
- .. __: https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-PQCONNINFO
-
- .. versionadded:: 2.7
-
-
- .. index::
pair: Connection; Status
.. attribute:: status
@@ -882,6 +859,32 @@ The ``connection`` class
.. versionadded:: 2.0.12
+ .. index::
+ pair: Connection; Parameters
+
+ .. method:: get_dsn_parameters()
+
+ Also available as `~connection.info`\ `!.`\
+ `~psycopg2.extensions.ConnectionInfo.dsn_parameters`.
+
+ Get the effective dsn parameters for the connection as a dictionary.
+
+ The *password* parameter is removed from the result.
+
+ Example::
+
+ >>> conn.get_dsn_parameters()
+ {'dbname': 'test', 'user': 'postgres', 'port': '5432', 'sslmode': 'prefer'}
+
+ Requires libpq >= 9.3.
+
+ .. seealso:: libpq docs for `PQconninfo()`__ for details.
+
+ .. __: https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-PQCONNINFO
+
+ .. versionadded:: 2.7
+
+
.. testcode::
:hide:
diff --git a/doc/src/extensions.rst b/doc/src/extensions.rst
index ee45bec..22d9b5d 100644
--- a/doc/src/extensions.rst
+++ b/doc/src/extensions.rst
@@ -165,6 +165,15 @@ introspection etc.
.. autoattribute:: host
.. autoattribute:: port
.. autoattribute:: options
+ .. autoattribute:: dsn_parameters
+
+ Example::
+
+ >>> conn.info.dsn_parameters
+ {'dbname': 'test', 'user': 'postgres', 'port': '5432', 'sslmode': 'prefer'}
+
+ Requires libpq >= 9.3.
+
.. autoattribute:: status
.. autoattribute:: transaction_status
.. automethod:: parameter_status(name)