Re: [sqlalchemy] Postgres array containment query generates FROM-clause that causes failure

2019-08-12 Thread Mike Bayer
the changes set up for the 1.4 series are *extremely* significant, and are intended to push us towards a "SQLAlchemy 2.0" concept that will more clearly embrace the future of Python which includes Py3 only as well as static typing. I am still holding off on completely blogging all of this

Re: [sqlalchemy] Postgres array containment query generates FROM-clause that causes failure

2019-08-12 Thread Elmer de Looff
Hi Mike, I've been playing around with the Postgresql dialect array() type a bit more and have something that appears to work, at least for the small case that I'm trying to solve for myself. I'd like to check whether I'm on the right track with how I'm approaching this though so please find a

Re: [sqlalchemy] Postgres array containment query generates FROM-clause that causes failure

2019-08-09 Thread Elmer de Looff
I've been milling over your comment regarding the func.array vs array approaches, and that makes a lot of sense. Currently any array(iterable) statement gets turned into an ARRAY[] literal in Postgres. Extending this to emit an ARRAY() constructor when array(query) is called seems like a

Re: [sqlalchemy] Postgres array containment query generates FROM-clause that causes failure

2019-08-08 Thread Mike Bayer
On Thu, Aug 8, 2019, at 11:56 AM, Elmer de Looff wrote: > Thanks for the quick response and solution! > > Having the answer, it seems obvious enough, but getting to the solution from > the problem was hard, despite excellent documentation, Not sure it deserves > an FAQ entry as it might be a

Re: [sqlalchemy] Postgres array containment query generates FROM-clause that causes failure

2019-08-08 Thread Elmer de Looff
Thanks for the quick response and solution! Having the answer, it seems obvious enough, but getting to the solution from the problem was hard, despite excellent documentation, Not sure it deserves an FAQ entry as it might be a bit of an infrequent problem, but maybe that'll help the next person.

Re: [sqlalchemy] Postgres array containment query generates FROM-clause that causes failure

2019-08-08 Thread Mike Bayer
On Thu, Aug 8, 2019, at 9:48 AM, Elmer de Looff wrote: > Hi, > > I'm trying to create a query to check whether a small number of given keys > are all present within a selection of a table. Postgres provides array > types/functions for this to check sub/superset properties, which seem to do >

[sqlalchemy] Postgres array containment query generates FROM-clause that causes failure

2019-08-08 Thread Elmer de Looff
Hi, I'm trying to create a query to check whether a small number of given keys are all present within a selection of a table. Postgres provides array types/functions for this to check sub/superset properties, which seem to do what I want. The query I'm trying to create is one of the following