MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / _make_proxy

Method _make_proxy

lib/sqlalchemy/sql/elements.py:4678–4712  ·  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

4676 )
4677
4678 def _make_proxy(
4679 self,
4680 selectable: FromClause,
4681 *,
4682 primary_key: ColumnSet,
4683 foreign_keys: Set[KeyedColumnElement[Any]],
4684 name: Optional[str] = None,
4685 key: Optional[str] = None,
4686 name_is_truncatable: bool = False,
4687 compound_select_cols: Optional[Sequence[ColumnElement[Any]]] = None,
4688 disallow_is_literal: bool = False,
4689 **kw: Any,
4690 ) -> typing_Tuple[str, ColumnClause[_T]]:
4691 c = ColumnClause(
4692 (
4693 coercions.expect(roles.TruncatedLabelRole, name or self.name)
4694 if name_is_truncatable
4695 else (name or self.name)
4696 ),
4697 type_=self.type,
4698 _selectable=selectable,
4699 is_literal=False,
4700 )
4701
4702 c._propagate_attrs = selectable._propagate_attrs
4703 if name is None:
4704 c.key = self.key
4705 if compound_select_cols:
4706 c._proxies = list(compound_select_cols)
4707 else:
4708 c._proxies = [self]
4709
4710 if selectable._is_clone_of is not None:
4711 c._is_clone_of = selectable._is_clone_of.columns.get(c.key)
4712 return c.key, c
4713
4714
4715_PS = ParamSpec("_PS")

Callers

nothing calls this directly

Calls 2

ColumnClauseClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected