public inbox for [email protected]
help / color / mirror / Atom feedRe: Integration of Psycopg with XTA
22+ messages / 3 participants
[nested] [flat]
* Re: Integration of Psycopg with XTA
@ 2018-10-02 20:07 Christian Ferrari <[email protected]>
2018-10-03 12:28 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
0 siblings, 1 reply; 22+ messages in thread
From: Christian Ferrari @ 2018-10-02 20:07 UTC (permalink / raw)
To: [email protected]
Hi Federico,I have been able to test _raw_pgconn using SWIG, as documented here https://sourceforge.net/p/swig/mailman/message/27919299/ , the trick to use PyCapsule and SWIG together is to specifically map the type with a directive like this one:
%typemap(in) PGconn * {
$1 = (PGconn *) PyCapsule_GetPointer($input, "psycopg2.connection._raw_pgconn");
}
This is interesting because PyCapsule is for sure a "clean" way to pass the pointer from Psycopg to XTA.
A couple of questions to understand how to implement it as a re-usable deliverable.
In current branch, _raw_pgconn is a property, it's not a method, I have to retrieve it as below:
pgconn = rm1._raw_pgconn
xar1 = PostgresqlXaResource(pgconn, "PostgreSQL", "dbname=testdb")
what do you think about a "getter method":
pgconn = rm1._raw_pgconn()
the name of the method does not really matter to me.
_raw_pgconn() create a Capsule object that should be destroyed.What do you think about a factory to create and destroy a PyCapsule that contains the PGconn pointer?
Kind RegardsCh.F.
-------------------------------------------------------------
Good design can't stop bad implementation
Il giovedì 27 settembre 2018, 22:11:35 CEST, Federico Di Gregorio <[email protected]> ha scritto:
On 09/27/2018 09:57 PM, Christian Ferrari wrote:
> Thanks, for the fix, now the function works, but unfortunately it's a
> dead end in the SWIG realm...Here's the statement:
> http://www.swig.org/Doc2.0/SWIGDocumentation.html#Python_nn18
> [...]
> *However, the inverse operation is not possible, i.e., you can't build a
> SWIG pointer object from a raw integer value.*
> [...]
>
> PyCapsule https://docs.python.org/2/c-api/capsule.html, suggested by
> Federico seems a more viable approach:
> https://bfroehle.com/2011/07/18/python-capsules/
>
> If Psycopg was able to retrieve a PyCapsule, XTA should be able to use
> it and the Python interpreter would be a gateway between two C/C++
> distinct modules (Psycopg and XTA).
> I'm going to perform some experiments in the XTA wrapper before coming
> back to this mail thread.
If you want the capsule, just pull from my report:
https://github.com/fogzot/psycopg2/tree/feature-expose-pgconn
and use the feature-expose-pgconn branch.
federico
--
Federico Di Gregorio [email protected]
DNDG srl http://dndg.it
Everything will be OK at the end. If it's not OK, it's not the end.
-- Unknown
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: Integration of Psycopg with XTA
2018-10-02 20:07 Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
@ 2018-10-03 12:28 ` Federico Di Gregorio <[email protected]>
2018-10-03 12:37 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
0 siblings, 1 reply; 22+ messages in thread
From: Federico Di Gregorio @ 2018-10-03 12:28 UTC (permalink / raw)
To: [email protected]
On 10/02/2018 10:07 PM, Christian Ferrari wrote:
> Hi Federico,
> I have been able to test _raw_pgconn using SWIG, as documented here
> https://sourceforge.net/p/swig/mailman/message/27919299/ , the trick to
> use PyCapsule and SWIG together is to specifically map the type with a
> directive like this one:
>
> %typemap(in) PGconn * {
> $1 = (PGconn *) PyCapsule_GetPointer($input,
> "psycopg2.connection._raw_pgconn");
> }
>
> This is interesting because PyCapsule is for sure a "clean" way to pass
> the pointer from Psycopg to XTA.
>
>
> A couple of questions to understand how to implement it as a re-usable
> deliverable.
>
> In current branch, _raw_pgconn is a property, it's not a method, I have
> to retrieve it as below:
>
> pgconn = rm1._raw_pgconn
> xar1 = PostgresqlXaResource(pgconn, "PostgreSQL", "dbname=testdb")
>
> what do you think about a "getter method":
>
> pgconn = rm1._raw_pgconn()
>
> the name of the method does not really matter to me.
>
> _raw_pgconn() create a Capsule object that should be destroyed.
Right now the getter creates a new capsule at every invocation so
transforming it into a method should be straightforward. I'll do it
later today so that you can test.
> What do you think about a factory to create and destroy a PyCapsule that
> contains the PGconn pointer?
Mm. I don't understand what you need here? Can you show an example of usage?
federico
--
Federico Di Gregorio [email protected]
DNDG srl http://dndg.it
Credo fermamente che da qualche parte, in una scatola ci sia un gatto
che non è vivo ne morto. Credo anche che se i fisici non si sbrigano
a dargli una scatoletta, ben presto sarà solo morto.
-- adattato da una frase di Sam Black Crow
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: Integration of Psycopg with XTA
2018-10-02 20:07 Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-03 12:28 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
@ 2018-10-03 12:37 ` Daniele Varrazzo <[email protected]>
2018-10-03 12:44 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
0 siblings, 1 reply; 22+ messages in thread
From: Daniele Varrazzo @ 2018-10-03 12:37 UTC (permalink / raw)
To: Federico Di Gregorio <[email protected]>; +Cc: [email protected]
On Wed, Oct 3, 2018 at 1:28 PM Federico Di Gregorio <[email protected]> wrote:
> > This is interesting because PyCapsule is for sure a "clean" way to pass
> > the pointer from Psycopg to XTA.
Fog, maybe it's worth adding the capsules for PGconn and PGresult to
the objects interface and document them? Can do that for psycopg 2.8.
-- Daniele
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: Integration of Psycopg with XTA
2018-10-02 20:07 Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-03 12:28 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-03 12:37 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
@ 2018-10-03 12:44 ` Federico Di Gregorio <[email protected]>
2018-10-03 12:52 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
0 siblings, 1 reply; 22+ messages in thread
From: Federico Di Gregorio @ 2018-10-03 12:44 UTC (permalink / raw)
To: Daniele Varrazzo <[email protected]>; +Cc: [email protected]
On 10/03/2018 02:37 PM, Daniele Varrazzo wrote:
> On Wed, Oct 3, 2018 at 1:28 PM Federico Di Gregorio<[email protected]> wrote:
>
>>> This is interesting because PyCapsule is for sure a "clean" way to pass
>>> the pointer from Psycopg to XTA.
> Fog, maybe it's worth adding the capsules for PGconn and PGresult to
> the objects interface and document them? Can do that for psycopg 2.8.
If it works I'd add it (and document it as an "internal" extension point
used by other C-level modules) for 2.8, yes.
By PGresult you mean adding it on the cursor, or the connection?
federico
--
Federico Di Gregorio [email protected]
DNDG srl http://dndg.it
Io non sono romantica. La candelina sul tavolo mi vede e si spegne.
-- sisterconfusion
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: Integration of Psycopg with XTA
2018-10-02 20:07 Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-03 12:28 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-03 12:37 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
2018-10-03 12:44 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
@ 2018-10-03 12:52 ` Daniele Varrazzo <[email protected]>
2018-10-03 13:03 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
0 siblings, 1 reply; 22+ messages in thread
From: Daniele Varrazzo @ 2018-10-03 12:52 UTC (permalink / raw)
To: Federico Di Gregorio <[email protected]>; +Cc: [email protected]
On Wed, Oct 3, 2018 at 1:44 PM Federico Di Gregorio <[email protected]> wrote:
>
> On 10/03/2018 02:37 PM, Daniele Varrazzo wrote:
> > On Wed, Oct 3, 2018 at 1:28 PM Federico Di Gregorio<[email protected]> wrote:
> >
> >>> This is interesting because PyCapsule is for sure a "clean" way to pass
> >>> the pointer from Psycopg to XTA.
> > Fog, maybe it's worth adding the capsules for PGconn and PGresult to
> > the objects interface and document them? Can do that for psycopg 2.8.
>
> If it works I'd add it (and document it as an "internal" extension point
> used by other C-level modules) for 2.8, yes.
>
> By PGresult you mean adding it on the cursor, or the connection?
Yes, i'd say a _pgconn attribute or _get_pgconn() method on the
connection, a _pgresult thing on the cursor.
By the way a read-only attribute as per your implementation seems
appropriate to me. Christian, why do you think a function would be
better?
-- Daniele
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: Integration of Psycopg with XTA
2018-10-02 20:07 Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-03 12:28 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-03 12:37 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
2018-10-03 12:44 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-03 12:52 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
@ 2018-10-03 13:03 ` Federico Di Gregorio <[email protected]>
2018-10-03 20:50 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
0 siblings, 1 reply; 22+ messages in thread
From: Federico Di Gregorio @ 2018-10-03 13:03 UTC (permalink / raw)
To: Daniele Varrazzo <[email protected]>; +Cc: [email protected]
On 10/03/2018 02:52 PM, Daniele Varrazzo wrote:
> On Wed, Oct 3, 2018 at 1:44 PM Federico Di Gregorio<[email protected]> wrote:
>> On 10/03/2018 02:37 PM, Daniele Varrazzo wrote:
>>> On Wed, Oct 3, 2018 at 1:28 PM Federico Di Gregorio<[email protected]> wrote:
>>>
>>>>> This is interesting because PyCapsule is for sure a "clean" way to pass
>>>>> the pointer from Psycopg to XTA.
>>> Fog, maybe it's worth adding the capsules for PGconn and PGresult to
>>> the objects interface and document them? Can do that for psycopg 2.8.
>> If it works I'd add it (and document it as an "internal" extension point
>> used by other C-level modules) for 2.8, yes.
>>
>> By PGresult you mean adding it on the cursor, or the connection?
> Yes, i'd say a _pgconn attribute or _get_pgconn() method on the
> connection, a _pgresult thing on the cursor.
>
> By the way a read-only attribute as per your implementation seems
> appropriate to me. Christian, why do you think a function would be
> better?
I guess the capsule is meant to be consumed by the other API and using a
method makes is explicit that a new object is instantiated every time. I
really don't care about this, let's do whatever is more Pythonic.
federico
--
Federico Di Gregorio [email protected]
DNDG srl http://dndg.it
I did appreciate the irony that I was whining about encoding issues on
a mailing list that was unable to show those chars, too.
-- Antti S. Lankila to mono-devel-list@
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: Integration of Psycopg with XTA
2018-10-02 20:07 Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-03 12:28 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-03 12:37 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
2018-10-03 12:44 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-03 12:52 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
2018-10-03 13:03 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
@ 2018-10-03 20:50 ` Christian Ferrari <[email protected]>
2018-10-04 09:32 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
0 siblings, 1 reply; 22+ messages in thread
From: Christian Ferrari @ 2018-10-03 20:50 UTC (permalink / raw)
To: Daniele Varrazzo <[email protected]>; Federico Di Gregorio <[email protected]>; +Cc: [email protected]
On 10/03/2018 02:52 PM, Daniele Varrazzo wrote:
> On Wed, Oct 3, 2018 at 1:44 PM Federico Di Gregorio<[email protected]> wrote:
>> On 10/03/2018 02:37 PM, Daniele Varrazzo wrote:
>>> On Wed, Oct 3, 2018 at 1:28 PM Federico Di Gregorio<[email protected]> wrote:
>>>
>>>>> This is interesting because PyCapsule is for sure a "clean" way to pass
>>>>> the pointer from Psycopg to XTA.
>>> Fog, maybe it's worth adding the capsules for PGconn and PGresult to
>>> the objects interface and document them? Can do that for psycopg 2.8.
>> If it works I'd add it (and document it as an "internal" extension point
>> used by other C-level modules) for 2.8, yes.
>>
>> By PGresult you mean adding it on the cursor, or the connection?
> Yes, i'd say a _pgconn attribute or _get_pgconn() method on the
> connection, a _pgresult thing on the cursor.
>
> By the way a read-only attribute as per your implementation seems
> appropriate to me. Christian, why do you think a function would be
> better?
> I guess the capsule is meant to be consumed by the other API and using a
> method makes is explicit that a new object is instantiated every time. I
> really don't care about this, let's do whatever is more Pythonic.
Dear Daniele & Federico,I'm not a "pythonist" at all, I can't provide suggestions about "Python style".In oo context, typically I expect to call a method when I need to retrieve something, that's why I proposed a method instead of a property.Anyway, my obscure question was related to garbage collection: who is in charge of destroying the capsule and how it must be destroyed?Looking at this example:
pgconn = xx._get_pgconn()do_something(pgconn)pgconn = yy._get_pgconn()
will the first capsule be automatically destroyed by the Python runtime when pgconn is assigned to another one (yy....)? Or some explicit statement must be executed?
If everything is automatically managed by the Python runtime, I will be very happy. If "do_something()" must release the capsule to avoid memory leaks, I have to implement it.
I will be very happy to test a "release candidate" version of the feature and link next LIXA/XTA release with psycopg 2.8.
K.R.Ch.F.
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: Integration of Psycopg with XTA
2018-10-02 20:07 Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-03 12:28 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-03 12:37 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
2018-10-03 12:44 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-03 12:52 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
2018-10-03 13:03 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-03 20:50 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
@ 2018-10-04 09:32 ` Federico Di Gregorio <[email protected]>
2018-10-04 10:13 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
0 siblings, 1 reply; 22+ messages in thread
From: Federico Di Gregorio @ 2018-10-04 09:32 UTC (permalink / raw)
To: [email protected]
On 10/03/2018 10:50 PM, Christian Ferrari wrote:
[snip]
> > I guess the capsule is meant to be consumed by the other API and using a
> > method makes is explicit that a new object is instantiated every time. I
> > really don't care about this, let's do whatever is more Pythonic.
>
> Dear Daniele & Federico,
> I'm not a "pythonist" at all, I can't provide suggestions about "Python
> style".
> In oo context, typically I expect to call a method when I need to
> retrieve something, that's why I proposed a method instead of a property.
> Anyway, my obscure question was related to garbage collection: who is in
> charge of destroying the capsule and how it must be destroyed?
> Looking at this example:
>
> pgconn = xx._get_pgconn()
> do_something(pgconn)
> pgconn = yy._get_pgconn()
>
> will the first capsule be automatically destroyed by the Python runtime
> when pgconn is assigned to another one (yy....)? Or some explicit
> statement must be executed?
> If everything is automatically managed by the Python runtime, I will be
> very happy. If "do_something()" must release the capsule to avoid memory
> leaks, I have to implement it.
The capsule is a standard reference-counted Python object. If the API
just use the pointer inside it and does not keep a reference to the
Python object itself, it will be free'd by the gc when the reference
count goes to 0. In your example, the first capsule is garbage collected
when you assign the second one to the same variable "pgconn".
@Daniele, I see that a capsule has an implicit state, "invalid" if the
pointer inside it is null. Does it makes sense to reuse the same capsule
and keep a reference to it to be able to invalidate it when the
connection is closed?
federico
--
Federico Di Gregorio [email protected]
DNDG srl http://dndg.it
The only thing I see is if you are pumping so much data into the
database all the time when do you expect to look at it?
-- Charlie Clark
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: Integration of Psycopg with XTA
2018-10-02 20:07 Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-03 12:28 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-03 12:37 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
2018-10-03 12:44 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-03 12:52 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
2018-10-03 13:03 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-03 20:50 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-04 09:32 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
@ 2018-10-04 10:13 ` Daniele Varrazzo <[email protected]>
2018-10-04 10:24 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
0 siblings, 1 reply; 22+ messages in thread
From: Daniele Varrazzo @ 2018-10-04 10:13 UTC (permalink / raw)
To: Federico Di Gregorio <[email protected]>; +Cc: [email protected]
On Thu, Oct 4, 2018 at 10:33 AM Federico Di Gregorio <[email protected]> wrote:
> @Daniele, I see that a capsule has an implicit state, "invalid" if the
> pointer inside it is null. Does it makes sense to reuse the same capsule
> and keep a reference to it to be able to invalidate it when the
> connection is closed?
I can take a look at it but I suspect it's a lot of work for a feature
very rarely used.
-- Daniele
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: Integration of Psycopg with XTA
2018-10-02 20:07 Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-03 12:28 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-03 12:37 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
2018-10-03 12:44 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-03 12:52 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
2018-10-03 13:03 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-03 20:50 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-04 09:32 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-04 10:13 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
@ 2018-10-04 10:24 ` Federico Di Gregorio <[email protected]>
2018-10-04 10:32 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
0 siblings, 1 reply; 22+ messages in thread
From: Federico Di Gregorio @ 2018-10-04 10:24 UTC (permalink / raw)
To: Daniele Varrazzo <[email protected]>; +Cc: [email protected]
On 10/04/2018 12:13 PM, Daniele Varrazzo wrote:
> On Thu, Oct 4, 2018 at 10:33 AM Federico Di Gregorio<[email protected]> wrote:
>> @Daniele, I see that a capsule has an implicit state, "invalid" if the
>> pointer inside it is null. Does it makes sense to reuse the same capsule
>> and keep a reference to it to be able to invalidate it when the
>> connection is closed?
> I can take a look at it but I suspect it's a lot of work for a feature
> very rarely used.
Nah, I can do it. I was just asking for your opinion. :D
federico
--
Federico Di Gregorio [email protected]
DNDG srl http://dndg.it
Best friends are often failed lovers. -- Me
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: Integration of Psycopg with XTA
2018-10-02 20:07 Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-03 12:28 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-03 12:37 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
2018-10-03 12:44 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-03 12:52 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
2018-10-03 13:03 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-03 20:50 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-04 09:32 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-04 10:13 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
2018-10-04 10:24 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
@ 2018-10-04 10:32 ` Daniele Varrazzo <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Daniele Varrazzo @ 2018-10-04 10:32 UTC (permalink / raw)
To: Federico Di Gregorio <[email protected]>; +Cc: [email protected]
On Thu, Oct 4, 2018 at 11:24 AM Federico Di Gregorio <[email protected]> wrote:
>
> On 10/04/2018 12:13 PM, Daniele Varrazzo wrote:
> > On Thu, Oct 4, 2018 at 10:33 AM Federico Di Gregorio<[email protected]> wrote:
> >> @Daniele, I see that a capsule has an implicit state, "invalid" if the
> >> pointer inside it is null. Does it makes sense to reuse the same capsule
> >> and keep a reference to it to be able to invalidate it when the
> >> connection is closed?
> > I can take a look at it but I suspect it's a lot of work for a feature
> > very rarely used.
>
> Nah, I can do it. I was just asking for your opinion. :D
I don't know much about the capsule object, its life cycle etc. Yes,
not a huge deal saving it in the connection state and returning always
the same. I just wonder if it's worth the effort.
-- Daniele
^ permalink raw reply [nested|flat] 22+ messages in thread
* Fwd: Re: Integration of Psycopg with XTA
@ 2018-10-04 10:36 Federico Di Gregorio <[email protected]>
2018-10-04 20:33 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
0 siblings, 1 reply; 22+ messages in thread
From: Federico Di Gregorio @ 2018-10-04 10:36 UTC (permalink / raw)
To: [email protected]
On 10/04/2018 12:30 PM, Daniele Varrazzo wrote:
> On Thu, Oct 4, 2018 at 11:24 AM Federico Di Gregorio<[email protected]> wrote:
>> On 10/04/2018 12:13 PM, Daniele Varrazzo wrote:
>>> On Thu, Oct 4, 2018 at 10:33 AM Federico Di Gregorio<[email protected]>
wrote:
>>>> @Daniele, I see that a capsule has an implicit state, "invalid" if the
>>>> pointer inside it is null. Does it makes sense to reuse the same
capsule
>>>> and keep a reference to it to be able to invalidate it when the
>>>> connection is closed?
>>> I can take a look at it but I suspect it's a lot of work for a feature
>>> very rarely used.
>> Nah, I can do it. I was just asking for your opinion. :D
> I don't know much about the capsule object, its life cycle etc. Yes,
> not a huge deal saving it in the connection state and returning always
> the same. I just wonder if it's worth the effort.
I suppose it helps to debug the situation where the capsule is used
after the connection has been closed. Instead of a BOOM you get a nice
exception (if the consumer checks for it, obviously).
I'll work on this in my repo and if everything works we can integrate it
for 2.8.
federico
--
Federico Di Gregorio [email protected]
DNDG srl http://dndg.it
Gli avvoltoi cinesi si nutrono di arte, ma possono anche mangiare
i `domani'. -- Haruki Murakami
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: Integration of Psycopg with XTA
2018-10-04 10:36 Fwd: Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
@ 2018-10-04 20:33 ` Christian Ferrari <[email protected]>
2018-10-05 16:02 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
0 siblings, 1 reply; 22+ messages in thread
From: Christian Ferrari @ 2018-10-04 20:33 UTC (permalink / raw)
To: [email protected]
Dear Federico,I will test it as soon as it will be released on git.Kind RegardsCh.F.
-------------------------------------------------------------
Good design can't stop bad implementation
Il giovedì 4 ottobre 2018, 12:36:53 CEST, Federico Di Gregorio <[email protected]> ha scritto:
On 10/04/2018 12:30 PM, Daniele Varrazzo wrote:
> On Thu, Oct 4, 2018 at 11:24 AM Federico Di Gregorio<[email protected]> wrote:
>> On 10/04/2018 12:13 PM, Daniele Varrazzo wrote:
>>> On Thu, Oct 4, 2018 at 10:33 AM Federico Di Gregorio<[email protected]>
wrote:
>>>> @Daniele, I see that a capsule has an implicit state, "invalid" if the
>>>> pointer inside it is null. Does it makes sense to reuse the same
capsule
>>>> and keep a reference to it to be able to invalidate it when the
>>>> connection is closed?
>>> I can take a look at it but I suspect it's a lot of work for a feature
>>> very rarely used.
>> Nah, I can do it. I was just asking for your opinion. :D
> I don't know much about the capsule object, its life cycle etc. Yes,
> not a huge deal saving it in the connection state and returning always
> the same. I just wonder if it's worth the effort.
I suppose it helps to debug the situation where the capsule is used
after the connection has been closed. Instead of a BOOM you get a nice
exception (if the consumer checks for it, obviously).
I'll work on this in my repo and if everything works we can integrate it
for 2.8.
federico
--
Federico Di Gregorio [email protected]
DNDG srl http://dndg.it
Gli avvoltoi cinesi si nutrono di arte, ma possono anche mangiare
i `domani'. -- Haruki Murakami
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: Integration of Psycopg with XTA
2018-10-04 10:36 Fwd: Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-04 20:33 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
@ 2018-10-05 16:02 ` Christian Ferrari <[email protected]>
2018-10-07 11:56 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
0 siblings, 1 reply; 22+ messages in thread
From: Christian Ferrari @ 2018-10-05 16:02 UTC (permalink / raw)
To: [email protected]
In a previous mail I stated something like "the name of the method doesn't matter"...... after better thinking I realized a decent name might be better than other ones...Let me say:
get_native_conn()get_native_connection()
might be better than "get_something_pgconn" because the same type of method could be useful for other databases in the future...More or less all the databases use a "native connection", only PostgreSQL uses "PGconn connection".
Have a good w.e.Ch.F.
-------------------------------------------------------------
Good design can't stop bad implementation
Il giovedì 4 ottobre 2018, 12:36:53 CEST, Federico Di Gregorio <[email protected]> ha scritto:
On 10/04/2018 12:30 PM, Daniele Varrazzo wrote:
> On Thu, Oct 4, 2018 at 11:24 AM Federico Di Gregorio<[email protected]> wrote:
>> On 10/04/2018 12:13 PM, Daniele Varrazzo wrote:
>>> On Thu, Oct 4, 2018 at 10:33 AM Federico Di Gregorio<[email protected]>
wrote:
>>>> @Daniele, I see that a capsule has an implicit state, "invalid" if the
>>>> pointer inside it is null. Does it makes sense to reuse the same
capsule
>>>> and keep a reference to it to be able to invalidate it when the
>>>> connection is closed?
>>> I can take a look at it but I suspect it's a lot of work for a feature
>>> very rarely used.
>> Nah, I can do it. I was just asking for your opinion. :D
> I don't know much about the capsule object, its life cycle etc. Yes,
> not a huge deal saving it in the connection state and returning always
> the same. I just wonder if it's worth the effort.
I suppose it helps to debug the situation where the capsule is used
after the connection has been closed. Instead of a BOOM you get a nice
exception (if the consumer checks for it, obviously).
I'll work on this in my repo and if everything works we can integrate it
for 2.8.
federico
--
Federico Di Gregorio [email protected]
DNDG srl http://dndg.it
Gli avvoltoi cinesi si nutrono di arte, ma possono anche mangiare
i `domani'. -- Haruki Murakami
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: Integration of Psycopg with XTA
2018-10-04 10:36 Fwd: Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-04 20:33 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-05 16:02 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
@ 2018-10-07 11:56 ` Federico Di Gregorio <[email protected]>
2018-10-07 16:42 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-08 15:08 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
2018-10-10 21:10 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
0 siblings, 3 replies; 22+ messages in thread
From: Federico Di Gregorio @ 2018-10-07 11:56 UTC (permalink / raw)
To: [email protected]
On 10/05/2018 06:02 PM, Christian Ferrari wrote:
> In a previous mail I stated something like "the name of the method
> doesn't matter"...
> ... after better thinking I realized a decent name might be better than
> other ones...
> Let me say:
>
> get_native_conn()
> get_native_connection()
>
> might be better than "get_/something/_pgconn" because the same type of
> method could be useful for other databases in the future...
> More or less all the databases use a "native connection", only
> PostgreSQL uses "PGconn connection".
After some more checking I discovered that it isn't possible to
"invalidate" a PyCapsule so there is no way to tell if the pointer
inside it is still a valid libpq connection.
The current code (feel free to pull) adds a new method
get_native_connection()
that raise an exception if called on a closed connection. I better like
a method here because it gives the idea that you need to call it every
time you want a Capsule to pass to the target C API.
I also added some docs and a dumb test.
https://github.com/fogzot/psycopg2/tree/feature-expose-pgconn
@Daniele, if Christian reports no problems I'll merge this later for 2.8.
federico
--
Federico Di Gregorio [email protected]
DNDG srl http://dndg.it
Io non sono romantica. La candelina sul tavolo mi vede e si spegne.
-- sisterconfusion
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: Integration of Psycopg with XTA
2018-10-04 10:36 Fwd: Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-04 20:33 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-05 16:02 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-07 11:56 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
@ 2018-10-07 16:42 ` Christian Ferrari <[email protected]>
2018-10-07 16:53 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2 siblings, 1 reply; 22+ messages in thread
From: Christian Ferrari @ 2018-10-07 16:42 UTC (permalink / raw)
To: [email protected]
Hi Federico,I've just tryed out commit https://github.com/fogzot/psycopg2/commit/81addddaee2c690e925bb8f381e7bcb02ca97687 : get_native_connection() is in the interface, but unfortunately it seems to work differently than the old _raw_pgconn.
Here's my code snippet:
pgconn = rm1.get_native_connection()#pgconn = rm1._raw_pgconn
xar1 = PostgresqlXaResource(pgconn, "PostgreSQL", "dbname=testdb")
using get_native_connection(), I catch an error from XTA, the PGconn pointer is null.
I have reversed back to commit https://github.com/fogzot/psycopg2/commit/ccae5cae34051d6640ec6cbce6d9313778c509d3 : _raw_pgconn works as before.
Here's the code snippet:
#pgconn = rm1.get_native_connection()
pgconn = rm1._raw_pgconn
xar1 = PostgresqlXaResource(pgconn, "PostgreSQL", "dbname=testdb")
It works fine.
Should "get_native_connection()" used differently than "_raw_pgconn" ? What type of data are necessary to investigate the issue?
Thanks in advanceKind RegardsCh.F.
-------------------------------------------------------------
Good design can't stop bad implementation
Il domenica 7 ottobre 2018, 13:56:49 CEST, Federico Di Gregorio <[email protected]> ha scritto:
On 10/05/2018 06:02 PM, Christian Ferrari wrote:
> In a previous mail I stated something like "the name of the method
> doesn't matter"...
> ... after better thinking I realized a decent name might be better than
> other ones...
> Let me say:
>
> get_native_conn()
> get_native_connection()
>
> might be better than "get_/something/_pgconn" because the same type of
> method could be useful for other databases in the future...
> More or less all the databases use a "native connection", only
> PostgreSQL uses "PGconn connection".
After some more checking I discovered that it isn't possible to
"invalidate" a PyCapsule so there is no way to tell if the pointer
inside it is still a valid libpq connection.
The current code (feel free to pull) adds a new method
get_native_connection()
that raise an exception if called on a closed connection. I better like
a method here because it gives the idea that you need to call it every
time you want a Capsule to pass to the target C API.
I also added some docs and a dumb test.
https://github.com/fogzot/psycopg2/tree/feature-expose-pgconn
@Daniele, if Christian reports no problems I'll merge this later for 2.8.
federico
--
Federico Di Gregorio [email protected]
DNDG srl http://dndg.it
Io non sono romantica. La candelina sul tavolo mi vede e si spegne.
-- sisterconfusion
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: Integration of Psycopg with XTA
2018-10-04 10:36 Fwd: Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-04 20:33 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-05 16:02 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-07 11:56 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-07 16:42 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
@ 2018-10-07 16:53 ` Christian Ferrari <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Christian Ferrari @ 2018-10-07 16:53 UTC (permalink / raw)
To: [email protected]
Sorry for disturbing with my previous email... :(It was my fault: I didn't remember to check the key associated to the pointer in the capsule, now it's "psycopg2.connection.native_connection"...
Everything works as expected, get_native_connection() can be even inlined like below:
xar1 = PostgresqlXaResource(rm1.get_native_connection(), "PostgreSQL", "dbname=testdb")
Thank you so much for your support.Kind RegardsCh.F.
Il domenica 7 ottobre 2018, 18:42:31 CEST, Christian Ferrari <[email protected]> ha scritto:
Hi Federico,I've just tryed out commit https://github.com/fogzot/psycopg2/commit/81addddaee2c690e925bb8f381e7bcb02ca97687 : get_native_connection() is in the interface, but unfortunately it seems to work differently than the old _raw_pgconn.
Here's my code snippet:
pgconn = rm1.get_native_connection()#pgconn = rm1._raw_pgconn
xar1 = PostgresqlXaResource(pgconn, "PostgreSQL", "dbname=testdb")
using get_native_connection(), I catch an error from XTA, the PGconn pointer is null.
I have reversed back to commit https://github.com/fogzot/psycopg2/commit/ccae5cae34051d6640ec6cbce6d9313778c509d3 : _raw_pgconn works as before.
Here's the code snippet:
#pgconn = rm1.get_native_connection()
pgconn = rm1._raw_pgconn
xar1 = PostgresqlXaResource(pgconn, "PostgreSQL", "dbname=testdb")
It works fine.
Should "get_native_connection()" used differently than "_raw_pgconn" ? What type of data are necessary to investigate the issue?
Thanks in advanceKind RegardsCh.F.
-------------------------------------------------------------
Good design can't stop bad implementation
Il domenica 7 ottobre 2018, 13:56:49 CEST, Federico Di Gregorio <[email protected]> ha scritto:
On 10/05/2018 06:02 PM, Christian Ferrari wrote:
> In a previous mail I stated something like "the name of the method
> doesn't matter"...
> ... after better thinking I realized a decent name might be better than
> other ones...
> Let me say:
>
> get_native_conn()
> get_native_connection()
>
> might be better than "get_/something/_pgconn" because the same type of
> method could be useful for other databases in the future...
> More or less all the databases use a "native connection", only
> PostgreSQL uses "PGconn connection".
After some more checking I discovered that it isn't possible to
"invalidate" a PyCapsule so there is no way to tell if the pointer
inside it is still a valid libpq connection.
The current code (feel free to pull) adds a new method
get_native_connection()
that raise an exception if called on a closed connection. I better like
a method here because it gives the idea that you need to call it every
time you want a Capsule to pass to the target C API.
I also added some docs and a dumb test.
https://github.com/fogzot/psycopg2/tree/feature-expose-pgconn
@Daniele, if Christian reports no problems I'll merge this later for 2.8.
federico
--
Federico Di Gregorio [email protected]
DNDG srl http://dndg.it
Io non sono romantica. La candelina sul tavolo mi vede e si spegne.
-- sisterconfusion
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: Integration of Psycopg with XTA
2018-10-04 10:36 Fwd: Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-04 20:33 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-05 16:02 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-07 11:56 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
@ 2018-10-08 15:08 ` Daniele Varrazzo <[email protected]>
2018-10-08 19:51 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2 siblings, 1 reply; 22+ messages in thread
From: Daniele Varrazzo @ 2018-10-08 15:08 UTC (permalink / raw)
To: Federico Di Gregorio <[email protected]>; +Cc: [email protected]
On Sun, Oct 7, 2018 at 12:56 PM Federico Di Gregorio <[email protected]> wrote:
> After some more checking I discovered that it isn't possible to
> "invalidate" a PyCapsule so there is no way to tell if the pointer
> inside it is still a valid libpq connection.
>
> The current code (feel free to pull) adds a new method
>
> get_native_connection()
>
> that raise an exception if called on a closed connection. I better like
> a method here because it gives the idea that you need to call it every
> time you want a Capsule to pass to the target C API.
>
> I also added some docs and a dumb test.
>
> https://github.com/fogzot/psycopg2/tree/feature-expose-pgconn
>
> @Daniele, if Christian reports no problems I'll merge this later for 2.8.
LGTM. Do we also want a cursor.get_native_result() to return its PGresult?
-- Daniele
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: Integration of Psycopg with XTA
2018-10-04 10:36 Fwd: Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-04 20:33 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-05 16:02 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-07 11:56 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-08 15:08 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
@ 2018-10-08 19:51 ` Christian Ferrari <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Christian Ferrari @ 2018-10-08 19:51 UTC (permalink / raw)
To: psycopg
> LGTM. Do we also want a cursor.get_native_result() to return its PGresult?
> -- Daniele
I have no idea about a use case that can use cursor.get_native_result() ......but who can tell?!
Kind RegardsCh.F.
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: Integration of Psycopg with XTA
2018-10-04 10:36 Fwd: Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-04 20:33 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-05 16:02 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-07 11:56 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
@ 2018-10-10 21:10 ` Christian Ferrari <[email protected]>
2018-10-10 21:19 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2 siblings, 1 reply; 22+ messages in thread
From: Christian Ferrari @ 2018-10-10 21:10 UTC (permalink / raw)
To: [email protected]
By the way, PyMySQL/mysqlclient-python project asked me to rename the method from "get_native_conn()" to "_get_native_conn()".
I'm not a "naming addicted person", but from the developer point of view, using two different methods would be for sure not appreciated...
xar1 = PostgresqlXaResource(rm1.get_native_connection(), "PostgreSQL", "dbname=testdb")
xar2 = MysqlXaResource(rm2._get_native_connection(), "MySQL", "localhost,0,lixa,,lixa")
If you don't mind, I kindly ask you to wait a couple of days: I hope to close the pull request https://github.com/PyMySQL/mysqlclient-python/pull/269 shortly...
Thank you in advanceKind RegardsCh.F.
-------------------------------------------------------------
Good design can't stop bad implementation
Il domenica 7 ottobre 2018, 13:56:49 CEST, Federico Di Gregorio <[email protected]> ha scritto:
On 10/05/2018 06:02 PM, Christian Ferrari wrote:
> In a previous mail I stated something like "the name of the method
> doesn't matter"...
> ... after better thinking I realized a decent name might be better than
> other ones...
> Let me say:
>
> get_native_conn()
> get_native_connection()
>
> might be better than "get_/something/_pgconn" because the same type of
> method could be useful for other databases in the future...
> More or less all the databases use a "native connection", only
> PostgreSQL uses "PGconn connection".
After some more checking I discovered that it isn't possible to
"invalidate" a PyCapsule so there is no way to tell if the pointer
inside it is still a valid libpq connection.
The current code (feel free to pull) adds a new method
get_native_connection()
that raise an exception if called on a closed connection. I better like
a method here because it gives the idea that you need to call it every
time you want a Capsule to pass to the target C API.
I also added some docs and a dumb test.
https://github.com/fogzot/psycopg2/tree/feature-expose-pgconn
@Daniele, if Christian reports no problems I'll merge this later for 2.8.
federico
--
Federico Di Gregorio [email protected]
DNDG srl http://dndg.it
Io non sono romantica. La candelina sul tavolo mi vede e si spegne.
-- sisterconfusion
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: Integration of Psycopg with XTA
2018-10-04 10:36 Fwd: Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-04 20:33 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-05 16:02 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-07 11:56 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-10 21:10 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
@ 2018-10-10 21:19 ` Federico Di Gregorio <[email protected]>
2018-10-11 18:46 ` Re: Integration of Psycopg with XTA Daniele Varrazzo <[email protected]>
0 siblings, 1 reply; 22+ messages in thread
From: Federico Di Gregorio @ 2018-10-10 21:19 UTC (permalink / raw)
To: [email protected]
On 10/10/2018 11:10 PM, Christian Ferrari wrote:
> By the way, PyMySQL/mysqlclient-python project
> <https://github.com/PyMySQL/mysqlclient-python; asked me to rename the
> method from "get_native_conn()" to "_get_native_conn()".
>
> I'm not a "naming addicted person", but from the developer point of
> view, using two different methods would be for sure not appreciated...
>
> xar1 = PostgresqlXaResource(rm1.get_native_connection(), "PostgreSQL",
> "dbname=testdb")
> xar2 = MysqlXaResource(rm2._get_native_connection(), "MySQL",
> "localhost,0,lixa,,lixa")
>
> If you don't mind, I kindly ask you to wait a couple of days: I hope to
> close the pull request
> https://github.com/PyMySQL/mysqlclient-python/pull/269 shortly...
I think that _if_ this should go cross-database a method without the
underscore is better. The underscore usually means private and that's
good as long as it is just that. An informal "standard" method name
should not have the "_" in it.
federico
--
Federico Di Gregorio [email protected]
DNDG srl http://dndg.it
Gli esseri umani, a volte, sono destinati, per il solo fatto di
esistere, a fare del male a qualcuno. -- Haruki Murakami
^ permalink raw reply [nested|flat] 22+ messages in thread
* Re: Integration of Psycopg with XTA
2018-10-04 10:36 Fwd: Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-04 20:33 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-05 16:02 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-07 11:56 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-10 21:10 ` Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-10 21:19 ` Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
@ 2018-10-11 18:46 ` Daniele Varrazzo <[email protected]>
0 siblings, 0 replies; 22+ messages in thread
From: Daniele Varrazzo @ 2018-10-11 18:46 UTC (permalink / raw)
To: Federico Di Gregorio <[email protected]>; +Cc: [email protected]
On Wed, Oct 10, 2018 at 10:19 PM Federico Di Gregorio <[email protected]> wrote:
>
> On 10/10/2018 11:10 PM, Christian Ferrari wrote:
> > By the way, PyMySQL/mysqlclient-python project
> > <https://github.com/PyMySQL/mysqlclient-python; asked me to rename the
> > method from "get_native_conn()" to "_get_native_conn()".
> I think that _if_ this should go cross-database a method without the
> underscore is better. The underscore usually means private and that's
> good as long as it is just that. An informal "standard" method name
> should not have the "_" in it.
+1
-- Daniele
^ permalink raw reply [nested|flat] 22+ messages in thread
end of thread, other threads:[~2018-10-11 18:46 UTC | newest]
Thread overview: 22+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-10-02 20:07 Re: Integration of Psycopg with XTA Christian Ferrari <[email protected]>
2018-10-03 12:28 ` Federico Di Gregorio <[email protected]>
2018-10-03 12:37 ` Daniele Varrazzo <[email protected]>
2018-10-03 12:44 ` Federico Di Gregorio <[email protected]>
2018-10-03 12:52 ` Daniele Varrazzo <[email protected]>
2018-10-03 13:03 ` Federico Di Gregorio <[email protected]>
2018-10-03 20:50 ` Christian Ferrari <[email protected]>
2018-10-04 09:32 ` Federico Di Gregorio <[email protected]>
2018-10-04 10:13 ` Daniele Varrazzo <[email protected]>
2018-10-04 10:24 ` Federico Di Gregorio <[email protected]>
2018-10-04 10:32 ` Daniele Varrazzo <[email protected]>
2018-10-04 10:36 Fwd: Re: Integration of Psycopg with XTA Federico Di Gregorio <[email protected]>
2018-10-04 20:33 ` Christian Ferrari <[email protected]>
2018-10-05 16:02 ` Christian Ferrari <[email protected]>
2018-10-07 11:56 ` Federico Di Gregorio <[email protected]>
2018-10-07 16:42 ` Christian Ferrari <[email protected]>
2018-10-07 16:53 ` Christian Ferrari <[email protected]>
2018-10-08 15:08 ` Daniele Varrazzo <[email protected]>
2018-10-08 19:51 ` Christian Ferrari <[email protected]>
2018-10-10 21:10 ` Christian Ferrari <[email protected]>
2018-10-10 21:19 ` Federico Di Gregorio <[email protected]>
2018-10-11 18:46 ` Daniele Varrazzo <[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