I have a "parent-child" relationship and i want to query for update all 
children with  their parents eager loaded. But that doesn't work as outer joins 
are not allowed in "SELECT ..FOR UPDATE" queries in postgresql and eagerload 
always produce outer join.

The only solution (and only for most recent revision) i have found is to use 
explicit join and contains_eager:

session.query(Child)\
        .with_lockmode("update")\
        .join("parent") \
        .options(contains_eager("parent"))

but it's doesn't look intuitively. 

So, do i miss something or eagerload should produce inner join for many-to-one 
relationship and if so, is there a chance to be fixed?

--
Yaroslav Boldyrev



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to