[sqlalchemy] How to log all SQL executed during database introspection?

2015-01-31 Thread Fabio C. Barrionuevo da Luz
Hello, how to log all SQL executed during database introspection? I would like to understand how exactly SQLAlchemy does on introspection the database. Sorry for my English, I am still learning. -- Fábio C. Barrionuevo da Luz Acadêmico de Sistemas de Informação na Faculdade Católica do Tocanti

Re: [sqlalchemy] Is it possible to populate relationship's collection with only query-filtered results using contains_eager()?

2015-01-31 Thread Michael Bayer
dia...@cry5tal.in wrote: > Ok, I've only put one() here for an example. I saw the query, there is no > LIMIT. And it selects only filtered results, as i wanted. > But I' m still unsure if i get it right about how SQLalchemy treat > contains_eager-does it load data for mentioned relationships

Re: [sqlalchemy] Is it possible to populate relationship's collection with only query-filtered results using contains_eager()?

2015-01-31 Thread diario
Ok, I've only put one() here for an example. I saw the query, there is no LIMIT. And it selects only filtered results, as i wanted. But I' m still unsure if i get it right about how SQLalchemy treat contains_eager-does it load data for mentioned relationships only from query which we declare th

Re: [sqlalchemy] Is it possible to populate relationship's collection with only query-filtered results using contains_eager()?

2015-01-31 Thread Michael Bayer
Юрий Пайков wrote: > When I do a query like this > > result = session.query(A).\ > join(A.bs).\ > join(B.cs).\ > filter_by(C.somedata.in_([4455, 4466])).\ > options(contains_eager(A.bs).contains_eager(B.cs)).one() > > and list related C objects > > for b in result.bs: >b.cs > > I get al

[sqlalchemy] Is it possible to populate relationship's collection with only query-filtered results using contains_eager()?

2015-01-31 Thread Юрий Пайков
When I do a query like this result = session.query(A).\ join(A.bs).\ join(B.cs).\ filter_by(C.somedata.in_([4455, 4466])).\ options(contains_eager(A.bs).contains_eager(B.cs)).one() and list related C objects for b in result.bs: b.cs I get all related to B C objects instead of only those wi