Create a left outer join. Parameters are the same as that of :meth:`_expression.Select.join`. .. versionchanged:: 1.4 :meth:`_expression.Select.outerjoin` now creates a :class:`_sql.Join` object between a :class:`_sql.FromClause` source that is within the FROM
(
self,
target: _JoinTargetArgument,
onclause: Optional[_OnClauseArgument] = None,
*,
full: bool = False,
)
| 5710 | return self |
| 5711 | |
| 5712 | def outerjoin( |
| 5713 | self, |
| 5714 | target: _JoinTargetArgument, |
| 5715 | onclause: Optional[_OnClauseArgument] = None, |
| 5716 | *, |
| 5717 | full: bool = False, |
| 5718 | ) -> Self: |
| 5719 | """Create a left outer join. |
| 5720 | |
| 5721 | Parameters are the same as that of :meth:`_expression.Select.join`. |
| 5722 | |
| 5723 | .. versionchanged:: 1.4 :meth:`_expression.Select.outerjoin` now |
| 5724 | creates a :class:`_sql.Join` object between a |
| 5725 | :class:`_sql.FromClause` source that is within the FROM clause of |
| 5726 | the existing SELECT, and a given target :class:`_sql.FromClause`, |
| 5727 | and then adds this :class:`_sql.Join` to the FROM clause of the |
| 5728 | newly generated SELECT statement. This is completely reworked |
| 5729 | from the behavior in 1.3, which would instead create a subquery of |
| 5730 | the entire |
| 5731 | :class:`_expression.Select` and then join that subquery to the |
| 5732 | target. |
| 5733 | |
| 5734 | This is a **backwards incompatible change** as the previous behavior |
| 5735 | was mostly useless, producing an unnamed subquery rejected by |
| 5736 | most databases in any case. The new behavior is modeled after |
| 5737 | that of the very successful :meth:`_orm.Query.join` method in the |
| 5738 | ORM, in order to support the functionality of :class:`_orm.Query` |
| 5739 | being available by using a :class:`_sql.Select` object with an |
| 5740 | :class:`_orm.Session`. |
| 5741 | |
| 5742 | See the notes for this change at :ref:`change_select_join`. |
| 5743 | |
| 5744 | .. seealso:: |
| 5745 | |
| 5746 | :ref:`tutorial_select_join` - in the :doc:`/tutorial/index` |
| 5747 | |
| 5748 | :ref:`orm_queryguide_joins` - in the :ref:`queryguide_toplevel` |
| 5749 | |
| 5750 | :meth:`_expression.Select.join` |
| 5751 | |
| 5752 | """ |
| 5753 | return self.join(target, onclause=onclause, isouter=True, full=full) |
| 5754 | |
| 5755 | def get_final_froms(self) -> Sequence[FromClause]: |
| 5756 | """Compute the final displayed list of :class:`_expression.FromClause` |