[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 copia. l...@metapensiero.it

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. ops: ... it does *no

[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 Gaifas | comincerò ad aver

[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: Emanuele Gaifas | comincerò ad a

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 on its own, that is, using a debug build, I > ca

[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 users.id FROM users WHERE

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, Column, Integer, UnicodeText, MetaData import sqla

[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 sqlalchemy.dialects.postgresql as sapg metadata =

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 parse the SQL statement and look at operators, yo

[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 basic types like strings and d