MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _make_proxy

Method _make_proxy

lib/sqlalchemy/sql/elements.py:5105–5139  ·  view source on GitHub ↗
(
        self,
        selectable: FromClause,
        *,
        primary_key: ColumnSet,
        foreign_keys: Set[KeyedColumnElement[Any]],
        name: Optional[str] = None,
        key: Optional[str] = None,
        name_is_truncatable: bool = False,
        compound_select_cols: Optional[Sequence[ColumnElement[Any]]] = None,
        disallow_is_literal: bool = False,
        **kw: Any,
    )

Source from the content-addressed store, hash-verified

5103 )
5104
5105 def _make_proxy(
5106 self,
5107 selectable: FromClause,
5108 *,
5109 primary_key: ColumnSet,
5110 foreign_keys: Set[KeyedColumnElement[Any]],
5111 name: Optional[str] = None,
5112 key: Optional[str] = None,
5113 name_is_truncatable: bool = False,
5114 compound_select_cols: Optional[Sequence[ColumnElement[Any]]] = None,
5115 disallow_is_literal: bool = False,
5116 **kw: Any,
5117 ) -> typing_Tuple[str, ColumnClause[_T]]:
5118 c = ColumnClause(
5119 (
5120 coercions.expect(roles.TruncatedLabelRole, name or self.name)
5121 if name_is_truncatable
5122 else (name or self.name)
5123 ),
5124 type_=self.type,
5125 _selectable=selectable,
5126 is_literal=False,
5127 )
5128
5129 c._propagate_attrs = selectable._propagate_attrs
5130 if name is None:
5131 c.key = self.key
5132 if compound_select_cols:
5133 c._proxies = list(compound_select_cols)
5134 else:
5135 c._proxies = [self]
5136
5137 if selectable._is_clone_of is not None:
5138 c._is_clone_of = selectable._is_clone_of.columns.get(c.key)
5139 return c.key, c
5140
5141
5142_PS = ParamSpec("_PS")

Callers

nothing calls this directly

Calls 2

ColumnClauseClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected