[Sqlalchemy-tickets] Issue #2976: innerjoin=True is ignored on second joinedload() option (zzzeek/s
Brought to you by:
zzzeek
|
From: Ezra E. <iss...@bi...> - 2014-02-27 22:16:39
|
New issue 2976: innerjoin=True is ignored on second joinedload() option https://bitbucket.org/zzzeek/sqlalchemy/issue/2976/innerjoin-true-is-ignored-on-second Ezra Epstein: How should be (IMO): 1. joinedload (and join / contains_eager) should, by default, use the semantics of the declared / mapped relationship if there is one. Thus if the relationship is a to-one (uselist=False or innerjoin=True), then those attributes of the relationship should be discovered and used when building the SQL query. 2. If one specifies innerjoin=True on the (second) joinedload() it should be honored on that join. How it is: session.query(AClass).options(joinedload(AClass.rel1).joinedload(RelClass.rel2, innerjoin=True)).filter(AClass.attrib=='whatever').one() Yields two regular (default left outer) JOIN clauses. It should (I think) have INNER JOIN on the second of those clauses. |