public inbox for [email protected]
help / color / mirror / Atom feedAdding an informative object to the connection
3+ messages / 3 participants
[nested] [flat]
* Adding an informative object to the connection
@ 2018-10-12 16:46 Daniele Varrazzo <[email protected]>
2018-10-12 20:53 ` Re: Adding an informative object to the connection Marco De Paoli <[email protected]>
2018-10-15 05:29 ` Re: Adding an informative object to the connection Murtuza Zabuawala <[email protected]>
0 siblings, 2 replies; 3+ messages in thread
From: Daniele Varrazzo @ 2018-10-12 16:46 UTC (permalink / raw)
To: psycopg
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!
-- Daniele
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Adding an informative object to the connection
2018-10-12 16:46 Adding an informative object to the connection Daniele Varrazzo <[email protected]>
@ 2018-10-12 20:53 ` Marco De Paoli <[email protected]>
1 sibling, 0 replies; 3+ messages in thread
From: Marco De Paoli @ 2018-10-12 20:53 UTC (permalink / raw)
To: Daniele Varrazzo <[email protected]>; +Cc: psycopg
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Adding an informative object to the connection
2018-10-12 16:46 Adding an informative object to the connection Daniele Varrazzo <[email protected]>
@ 2018-10-15 05:29 ` Murtuza Zabuawala <[email protected]>
1 sibling, 0 replies; 3+ messages in thread
From: Murtuza Zabuawala @ 2018-10-15 05:29 UTC (permalink / raw)
To: Daniele Varrazzo <[email protected]>; +Cc: psycopg
+1
--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
On Fri, Oct 12, 2018 at 10:16 PM Daniele Varrazzo <
[email protected]> wrote:
> 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!
>
> -- Daniele
>
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2018-10-15 05:29 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-10-12 16:46 Adding an informative object to the connection Daniele Varrazzo <[email protected]>
2018-10-12 20:53 ` Marco De Paoli <[email protected]>
2018-10-15 05:29 ` Murtuza Zabuawala <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox