public inbox for [email protected]
help / color / mirror / Atom feedFrom: Marco De Paoli <[email protected]>
To: Daniele Varrazzo <[email protected]>
Cc: [email protected]
Subject: Re: Adding an informative object to the connection
Date: Fri, 12 Oct 2018 22:53:04 +0200
Message-ID: <CAPz0FjBmYo+VFUR_=cje5LsaU5qDWkJaQA0bXO=g51i1_uu=zw@mail.gmail.com> (raw)
In-Reply-To: <CA+mi_8Y+-0Tdb7ka9vnRVZgpa_hMWN1rB-K74+=idAeWFPSaUg@mail.gmail.com>
References: <CA+mi_8Y+-0Tdb7ka9vnRVZgpa_hMWN1rB-K74+=idAeWFPSaUg@mail.gmail.com>
Hi Daniele,
Il giorno ven 12 ott 2018 alle ore 18:46 Daniele Varrazzo <
[email protected]> ha scritto:
> Hi,
>
> a few days ago we were contributed a merge request for an `.host`
> attribute on the connection. But looking back at the bug
> (https://github.com/psycopg/psycopg2/issues/726) I had already noticed
> there are other interesting informative connection functions in the
> libpq. Some of them are already exposed as methods of the connection
> class (e.g. get_backend_pid(), get_transaction_status() etc), but I
> can see a trickle of requests for others, so I'd rather expose
> most/all of them.
>
> Instead of bloating the connection class with more and more attributes
> and methods, I'm rather adding a connection.info method to retrieve
> pgconn-specific information. The work is happening in this branch:
>
> https://github.com/psycopg/psycopg2/commits/connection-info
>
> I would softly deprecate the currently exposed informative methods:
> not sending them away in a short time but giving a preference to use
> from the 'info' object what belongs to the pgconn/libpq and to leave
> on the connection things regarding the Python layer, and clean up the
> interfaces a little bit.
>
> Any input is welcome. Cheers!
>
+1
good idea, clean and effective
-- Marco
view thread (3+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: Adding an informative object to the connection
In-Reply-To: <CAPz0FjBmYo+VFUR_=cje5LsaU5qDWkJaQA0bXO=g51i1_uu=zw@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox