[sqlalchemy] Re: About CASTing query parameters

2017-04-14 Thread Lele Gaifax
mike bayer writes: > yeah IMO this is a bug in asyncpg but of course your custom dialect can work > around that. Ok, thank you. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi

Re: [sqlalchemy] Re: About CASTing query parameters

2017-04-14 Thread mike bayer
yeah IMO this is a bug in asyncpg but of course your custom dialect can work around that. On 04/14/2017 04:31 PM, Lele Gaifax wrote: Lele Gaifax writes: I bet because it does want to fiddle with the SQL statement parsing, or with the formatting of parameter's values.

[sqlalchemy] Re: About CASTing query parameters

2017-04-14 Thread Lele Gaifax
Lele Gaifax writes: > I bet because it does want to fiddle with the SQL statement parsing, or with > the formatting of parameter's values. ops: ... it does *not* want... ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele

[sqlalchemy] Re: About CASTing query parameters

2017-04-14 Thread Lele Gaifax
Mike Bayer writes: > Right. So why can't asyncpg do that. I bet because it does want to fiddle with the SQL statement parsing, or with the formatting of parameter's values. ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real:

Re: [sqlalchemy] Re: About CASTing query parameters

2017-04-14 Thread Mike Bayer
Right. So why can't asyncpg do that. On Apr 14, 2017 12:45 PM, "Lele Gaifax" wrote: > Mike Bayer writes: > > > I know that, however (not at my computer at the moment) how does this > case > > work w psycopg2 ? > > I think that psycopg2 does that

[sqlalchemy] Re: About CASTing query parameters

2017-04-14 Thread Lele Gaifax
Mike Bayer writes: > I know that, however (not at my computer at the moment) how does this case > work w psycopg2 ? I think that psycopg2 does that on its own, that is, using a debug build, I can see that the effective statement it sends to the engine is SELECT

Re: [sqlalchemy] Re: About CASTing query parameters

2017-04-14 Thread Mike Bayer
On Apr 14, 2017 11:40 AM, "Lele Gaifax" wrote: Mike Bayer writes: > Can you show me the model and some sample data ? Is this the JSONB > datatype ? Sure, here it is: import datetime from sqlalchemy import create_engine, select, Table,

[sqlalchemy] Re: About CASTing query parameters

2017-04-14 Thread Lele Gaifax
Mike Bayer writes: > Can you show me the model and some sample data ? Is this the JSONB > datatype ? Sure, here it is: import datetime from sqlalchemy import create_engine, select, Table, Column, Integer, UnicodeText, MetaData import

Re: [sqlalchemy] Re: About CASTing query parameters

2017-04-14 Thread Mike Bayer
Can you show me the model and some sample data ? Is this the JSONB datatype ? On Apr 14, 2017 11:02 AM, "Lele Gaifax" wrote: > mike bayer writes: > > > I'm not sure what asyncpgs' issue is with input types, there should not > be a > > reason to

[sqlalchemy] Re: About CASTing query parameters

2017-04-14 Thread Lele Gaifax
mike bayer writes: > I'm not sure what asyncpgs' issue is with input types, there should not be a > reason to parse the SQL statement and look at operators, you have the Python > type of object coming in, you use that to determine the general behavior to > take with

Re: [sqlalchemy] About CASTing query parameters

2017-04-14 Thread mike bayer
On 04/14/2017 03:49 AM, Lele Gaifax wrote: mike bayer writes: However, we can improve upon the situation by adding a CAST, which seems to send psycopg2 a little more information: row = s.query( cast( func.array_agg(tuple_(A.x, A.y)), ARRAY(Unicode)

[sqlalchemy] NEED: SQL Developer with VB.Net Exp. - Spot In NYC_Locals Only_ 10+ Exp. !!

2017-04-14 Thread Prashant Kumar
*Dear Partner,* Hope you are doing great! Please find the requirement below and let me know if you have any candidates for the following position. Please add prashant.ku...@xiartech.com to your Hot Mailing List. *Position: SQL Developer with VB.Net Exp. - Spot in NYC* *Location: NYC, NY*

[sqlalchemy] About CASTing query parameters

2017-04-14 Thread Lele Gaifax
mike bayer writes: > However, we can improve upon the situation by adding a CAST, which seems to > send psycopg2 a little more information: > > row = s.query( > cast( > func.array_agg(tuple_(A.x, A.y)), ARRAY(Unicode) > ) > ).scalar() > print row For