yeah, eagerloading requires adding lots of extra columns to the  
column clause of the SELECT statement.  with most query operations,  
you are only providing the WHERE criterion, and Query generates the  
rest of everything around it, which is a fairly involved process.

if you use your own select object that already has columns etc.  
inside of it, the query object doesnt have so much ability to dig in  
there and modify it since it would likely screw up the original  
intent of the select object; so it just passes it through.  it  
assumes you know exactly what you want.

the objects you get back, while not eagerly loaded, should still  
function pretty well and have lazyloaders attached to its properties;  
if all that is working, then im pretty impressed :).


On Aug 12, 2006, at 11:43 AM, Steve Zatz wrote:

> I have a simple database structure that involves:
>
> item_table
> keyword_table
> itemkeyword_table
>
> with a many-to-many relationship between items and keywords and the
> expected mapper that defines item.keywords.
>
> None of this may be relevant since the basic problem is that if I
> create a query object such as:
>
> eagerquery = session.query(Item).options(eagerload('keywords'))
>
> If I use that query object directly to do a select, eager loading
> works fine.  However, if I create a select object by defining:
>
> statement = item_table.select()
>
> and then build up a query by using append_whereclause, when I do
>
> eagerquery.select(statement)
>
> the query works fine except the objects returned to not include  
> eager loading.
>
> Is this some limitation of using select objects in eagerloading  
> queries?
>
> ---------------------------------------------------------------------- 
> ---
> Using Tomcat but need to do more? Need to support web services,  
> security?
> Get stuff done quickly with pre-integrated technology to make your  
> job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache  
> Geronimo
> http://sel.as-us.falkag.net/sel? 
> cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Sqlalchemy-users mailing list
> Sqlalchemy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to