On Mar 27, 2007, at 10:00 AM, Julien Cigar wrote:
>
> Hello,
>
> I'm using SQLAlchemy 0.3.5, and it seems that the func() output is
> broken with some functions.
> I use the ANY function of PostgreSQL with something like :
> func.any(q.c.habitats)==filter_habitat
>
> SQLAlchemy translates this in:
> WHERE any(habitats) = %(any)s, which is incorrect.
>
> For example:
>
> the result should be :
> iasdev=> select true as result where 'abc' = ANY(array['abc', 'def']);
> result
> --------
> t
>
> where SQLAlchemy generates the query as :
>
> iasdev=> select true as result where ANY(array['abc', 'def']) = 'abc';
> ERROR: syntax error at or near "ANY" at character 29
> LINE 1: select true as result where ANY(array['abc', 'def']) =
> 'abc'...
>
> Is this a bug ? (or maybe it's possible to keep the order...) ?
can i have some complete code examples please ? i dont understand
how your snippet would produce a full SELECT statement. the phrase
youve shown me translates exactly as specified, assuming
"filter_habitat" is ia non ClauseElement::
func.any(q.c.habitats)==filter_habitat
should be:
any(habitats) = %(any)s
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---