Re: [sqlalchemy] Temporarily disable DB persistence for optimization routine

2018-01-05 Thread Mike Bayer
On Thu, Jan 4, 2018 at 12:05 PM, Ruben Di Battista wrote: > From the tests everything is working as expected. The problem is that I'm > getting some performance issues while performing the scheduling procedure: > this procedure needs to read the `constraints` and `weights` associated to > each sat

[sqlalchemy] Join on filter for chained loads

2018-01-05 Thread Erol Merdanović
Hi I have following relation A -> B (with filter) A -> C -> A -> B (with filter) and I want to load this in one query session.Query(A).join(A.b, and_(A.id == B.parent_id, B.field == 123)). options(contains_eager(A.b), joinedload(A.c).joinedload(C.a).joinedload(A.b )) how could I provide custom

Re: [sqlalchemy] group by and order by aliasing on custom dialects

2018-01-05 Thread Mike Bayer
On Fri, Jan 5, 2018 at 10:03 AM, Florian Apolloner wrote: > Hi Mike, > > you are to fast for me! Those work, thanks. > > Aside from the oracle requirements I also get: > ``` > 'Requirements' object has no attribute 'order_by_col_from_union' > ``` > -- should that be added to the base requirements

Re: [sqlalchemy] trouble with a self-referential query and remote side population

2018-01-05 Thread Jonathan Vanasco
On Thursday, January 4, 2018 at 10:58:49 AM UTC-5, Mike Bayer wrote: > > that and, when you use contains_eager you need to tell it what entity > it's looking for when it considers columns as part of a relationship: > > .options(sqlalchemy.orm.contains_eager('foo_alt', alias=Foo_2))\ > As

Re: [sqlalchemy] group by and order by aliasing on custom dialects

2018-01-05 Thread Florian Apolloner
Hi Mike, you are to fast for me! Those work, thanks. Aside from the oracle requirements I also get: ``` 'Requirements' object has no attribute 'order_by_col_from_union' ``` -- should that be added to the base requirements with exclusions.open? Cheers, Florian On Thursday, January 4, 2018 at 10

Re: [sqlalchemy] Extra table name in FROM clause

2018-01-05 Thread sector119
Here is SQL that works as expected: SELECT m.*, d.* FROM ( SELECT person_id, service_id, person_id_internal, meters_readings, -- two-dimensional array meters_readings [generate_subscripts(meters_readings, 1)] [1] AS meter_id, meters_readings [generate_subscripts(meters_r