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,
)
| 5965 | return self |
| 5966 | |
| 5967 | def outerjoin( |
| 5968 | self, |
| 5969 | target: _JoinTargetArgument, |
| 5970 | onclause: Optional[_OnClauseArgument] = None, |
| 5971 | *, |
| 5972 | full: bool = False, |
| 5973 | ) -> Self: |
| 5974 | """Create a left outer join. |
| 5975 | |
| 5976 | Parameters are the same as that of :meth:`_expression.Select.join`. |
| 5977 | |
| 5978 | .. versionchanged:: 1.4 :meth:`_expression.Select.outerjoin` now |
| 5979 | creates a :class:`_sql.Join` object between a |
| 5980 | :class:`_sql.FromClause` source that is within the FROM clause of |
| 5981 | the existing SELECT, and a given target :class:`_sql.FromClause`, |
| 5982 | and then adds this :class:`_sql.Join` to the FROM clause of the |
| 5983 | newly generated SELECT statement. This is completely reworked |
| 5984 | from the behavior in 1.3, which would instead create a subquery of |
| 5985 | the entire |
| 5986 | :class:`_expression.Select` and then join that subquery to the |
| 5987 | target. |
| 5988 | |
| 5989 | This is a **backwards incompatible change** as the previous behavior |
| 5990 | was mostly useless, producing an unnamed subquery rejected by |
| 5991 | most databases in any case. The new behavior is modeled after |
| 5992 | that of the very successful :meth:`_orm.Query.join` method in the |
| 5993 | ORM, in order to support the functionality of :class:`_orm.Query` |
| 5994 | being available by using a :class:`_sql.Select` object with an |
| 5995 | :class:`_orm.Session`. |
| 5996 | |
| 5997 | See the notes for this change at :ref:`change_select_join`. |
| 5998 | |
| 5999 | .. seealso:: |
| 6000 | |
| 6001 | :ref:`tutorial_select_join` - in the :doc:`/tutorial/index` |
| 6002 | |
| 6003 | :ref:`orm_queryguide_joins` - in the :ref:`queryguide_toplevel` |
| 6004 | |
| 6005 | :meth:`_expression.Select.join` |
| 6006 | |
| 6007 | """ |
| 6008 | return self.join(target, onclause=onclause, isouter=True, full=full) |
| 6009 | |
| 6010 | def get_final_froms(self) -> Sequence[FromClause]: |
| 6011 | """Compute the final displayed list of :class:`_expression.FromClause` |