- ON join(): ON . , ON, and_/or_. , ON :
query(A).join(B, A.b_id = B.id, A.x > N) # WRONG!
query(A).join(B, and_(A.b_id = B.id, A.x > N)) # CORRECT
Query.join() API SQLA , ( , join(*args, **kwargs) ). Query.join():
query(A).join(A.b)
query(A).join(B)
query(A).join(B, A.b_id = B.id)
query(A).join(B, _and(A.b_id = B.id, ...))
query(A).select_entity_from(B).join(A, isouter=True)
, :
- with an explicit clause ON and
Aand Bcan be not only display classes, but also any "selectable":, subquery()instance, Tableor alias ( aliased(selectable)). - without an explicit ON clause
Aand Bcan only be a display class or instanceTable
Timur source
share