mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 09:24:07 +03:00
Adding ConnectionInfo object documentation
I'm still fought whether docs should be in the C module or in the .rst. I'd prefer the first because DRY, but writing multiline strings in C really sucks.
This commit is contained in:
parent
0e2b516a3c
commit
9ddf59959f
|
@ -600,19 +600,12 @@ The ``connection`` class
|
||||||
|
|
||||||
|
|
||||||
.. index::
|
.. index::
|
||||||
pair: Backend; Host
|
pair: Connection; Info
|
||||||
|
|
||||||
.. attribute:: host
|
.. attribute:: info
|
||||||
|
|
||||||
The server host name of the active connection.
|
A `~psycopg2.extensions.ConnectionInfo` object exposing information
|
||||||
|
about the native libpq connection.
|
||||||
This can be a host name, an IP address, or a directory path if the
|
|
||||||
connection is via Unix socket. (The path case can be distinguished
|
|
||||||
because it will always be an absolute path, beginning with ``/``.)
|
|
||||||
|
|
||||||
.. seealso:: libpq docs for `PQhost()`__ for details.
|
|
||||||
|
|
||||||
.. __: https://www.postgresql.org/docs/current/static/libpq-status.html#LIBPQ-PQHOST
|
|
||||||
|
|
||||||
.. versionadded:: 2.8.0
|
.. versionadded:: 2.8.0
|
||||||
|
|
||||||
|
|
|
@ -154,6 +154,15 @@ introspection etc.
|
||||||
Close the object and remove it from the database.
|
Close the object and remove it from the database.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.. autoclass:: ConnectionInfo
|
||||||
|
|
||||||
|
.. versionadded:: 2.8
|
||||||
|
|
||||||
|
.. autoattribute:: host
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.. class:: Column
|
.. class:: Column
|
||||||
|
|
||||||
Description of one result column, exposed as items of the
|
Description of one result column, exposed as items of the
|
||||||
|
|
|
@ -61,7 +61,7 @@ from psycopg2._psycopg import ( # noqa
|
||||||
adapt, adapters, encodings, connection, cursor,
|
adapt, adapters, encodings, connection, cursor,
|
||||||
lobject, Xid, libpq_version, parse_dsn, quote_ident,
|
lobject, Xid, libpq_version, parse_dsn, quote_ident,
|
||||||
string_types, binary_types, new_type, new_array_type, register_type,
|
string_types, binary_types, new_type, new_array_type, register_type,
|
||||||
ISQLQuote, Notify, Diagnostics, Column,
|
ISQLQuote, Notify, Diagnostics, Column, ConnectionInfo,
|
||||||
QueryCanceledError, TransactionRollbackError,
|
QueryCanceledError, TransactionRollbackError,
|
||||||
set_wait_callback, get_wait_callback, encrypt_password, )
|
set_wait_callback, get_wait_callback, encrypt_password, )
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,15 @@
|
||||||
|
|
||||||
|
|
||||||
static const char host_doc[] =
|
static const char host_doc[] =
|
||||||
"The server host name of the active connection.";
|
"The server host name of the connection.\n"
|
||||||
|
"\n"
|
||||||
|
"This can be a host name, an IP address, or a directory path if the\n"
|
||||||
|
"connection is via Unix socket. (The path case can be distinguished\n"
|
||||||
|
"because it will always be an absolute path, beginning with ``/``.)\n"
|
||||||
|
"\n"
|
||||||
|
".. seealso:: libpq docs for `PQhost()`__ for details.\n"
|
||||||
|
".. __: https://www.postgresql.org/docs/current/static/libpq-status.html"
|
||||||
|
"#LIBPQ-PQHOST";
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
host_get(connInfoObject *self)
|
host_get(connInfoObject *self)
|
||||||
|
@ -88,7 +96,14 @@ conninfo_dealloc(connInfoObject* self)
|
||||||
/* object type */
|
/* object type */
|
||||||
|
|
||||||
static const char connInfoType_doc[] =
|
static const char connInfoType_doc[] =
|
||||||
"Details of a database connection.";
|
"Details about the native PostgreSQL database connection.\n"
|
||||||
|
"\n"
|
||||||
|
"This class exposes several `informative functions`__ about the status\n"
|
||||||
|
"of the libpq connection.\n"
|
||||||
|
"\n"
|
||||||
|
"Objects of this class are exposed as the `connection.info` attribute.\n"
|
||||||
|
"\n"
|
||||||
|
".. __: https://www.postgresql.org/docs/current/static/libpq-status.html";
|
||||||
|
|
||||||
PyTypeObject connInfoType = {
|
PyTypeObject connInfoType = {
|
||||||
PyVarObject_HEAD_INIT(NULL, 0)
|
PyVarObject_HEAD_INIT(NULL, 0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user