Can you show me the model and some sample data ?  Is this the JSONB
datatype ?

On Apr 14, 2017 11:02 AM, "Lele Gaifax" <l...@metapensiero.it> wrote:

> mike bayer <mike...@zzzcomputing.com> 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 dates.
>
> asyncpg does not parse the SQL statement, and it tries hard to not have to
> parse incoming data from the database, even, leaving all that to the PG
> engine.
>
> In my example, the column contains a daterange value, and the query I tried
> used the @> operator (what the SA .contains() on such type renders to):
> but as
> said in https://github.com/MagicStack/asyncpg/issues/32#
> issuecomment-254208760
> PG has not enough data (you can read that as "has a bug" if you prefer) to
> guess the right type, as the @> implements both "daterange contains scalar
> date" and "daterange is a superset of another daterange". Explicitly
> casting
> the input value solves the ambiguity.
>
> > So, what you have above is very easy to accomplish with a simple
> @compiles recipe that merely
> > adds CAST to the rendering of bindparam():
>
> Yes, I know, but since I need to tweak the representation of positional
> parameters (that is, $1 instead of :1), I had to touch the BIND_TEMPLATES
> content. That's why I thought a more generic approach of allowing an
> arbitrary, user controlled way to render the placeholders could be better.
>
> 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  |                 -- Fortunato Depero, 1929.
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and
> Verifiable Example.  See  http://stackoverflow.com/help/mcve for a full
> description.
> ---
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to