MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / __init__

Method __init__

lib/sqlalchemy/orm/util.py:1834–1953  ·  view source on GitHub ↗
(
        self,
        left: _FromClauseArgument,
        right: _FromClauseArgument,
        onclause: Optional[_OnClauseArgument] = None,
        isouter: bool = False,
        full: bool = False,
        _left_memo: Optional[Any] = None,
        _right_memo: Optional[Any] = None,
        _extra_criteria: Tuple[ColumnElement[bool], ...] = (),
    )

Source from the content-addressed store, hash-verified

1832 inherit_cache = True
1833
1834 def __init__(
1835 self,
1836 left: _FromClauseArgument,
1837 right: _FromClauseArgument,
1838 onclause: Optional[_OnClauseArgument] = None,
1839 isouter: bool = False,
1840 full: bool = False,
1841 _left_memo: Optional[Any] = None,
1842 _right_memo: Optional[Any] = None,
1843 _extra_criteria: Tuple[ColumnElement[bool], ...] = (),
1844 ):
1845 left_info = cast(
1846 "Union[FromClause, _InternalEntityType[Any]]",
1847 inspection.inspect(left),
1848 )
1849
1850 right_info = cast(
1851 "Union[FromClause, _InternalEntityType[Any]]",
1852 inspection.inspect(right),
1853 )
1854 adapt_to = right_info.selectable
1855
1856 # used by joined eager loader
1857 self._left_memo = _left_memo
1858 self._right_memo = _right_memo
1859
1860 if isinstance(onclause, attributes.QueryableAttribute):
1861 if TYPE_CHECKING:
1862 assert isinstance(
1863 onclause.comparator, RelationshipProperty.Comparator
1864 )
1865 on_selectable = onclause.comparator._source_selectable()
1866 prop = onclause.property
1867 _extra_criteria += onclause._extra_criteria
1868 elif isinstance(onclause, MapperProperty):
1869 # used internally by joined eager loader...possibly not ideal
1870 prop = onclause
1871 on_selectable = prop.parent.selectable
1872 else:
1873 prop = None
1874 on_selectable = None
1875
1876 left_selectable = left_info.selectable
1877 if prop:
1878 adapt_from: Optional[FromClause]
1879 if sql_util.clause_is_present(on_selectable, left_selectable):
1880 adapt_from = on_selectable
1881 else:
1882 assert isinstance(left_selectable, FromClause)
1883 adapt_from = left_selectable
1884
1885 (
1886 pj,
1887 sj,
1888 source,
1889 dest,
1890 secondary,
1891 target_adapter,

Callers

nothing calls this directly

Calls 12

is_selectableFunction · 0.85
insp_is_mapperFunction · 0.85
insp_is_aliased_classFunction · 0.85
_source_selectableMethod · 0.80
_create_joinsMethod · 0.80
castFunction · 0.50
joinMethod · 0.45
getMethod · 0.45
unionMethod · 0.45
__init__Method · 0.45
and_Method · 0.45
traverseMethod · 0.45

Tested by

no test coverage detected