MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / alias

Method alias

lib/sqlalchemy/sql/selectable.py:1977–1998  ·  view source on GitHub ↗

Return a new alias of this :class:`_sql.TableValuedAlias`. This creates a distinct FROM object that will be distinguished from the original one when used in a SQL statement.

(
        self, name: Optional[str] = None, flat: bool = False
    )

Source from the content-addressed store, hash-verified

1975 return TableValuedColumn(self, self._tableval_type)
1976
1977 def alias(
1978 self, name: Optional[str] = None, flat: bool = False
1979 ) -> TableValuedAlias:
1980 """Return a new alias of this :class:`_sql.TableValuedAlias`.
1981
1982 This creates a distinct FROM object that will be distinguished
1983 from the original one when used in a SQL statement.
1984
1985 """
1986
1987 tva: TableValuedAlias = TableValuedAlias._construct(
1988 self,
1989 name=name,
1990 table_value_type=self._tableval_type,
1991 joins_implicitly=self.joins_implicitly,
1992 )
1993
1994 if self._render_derived:
1995 tva._render_derived = True
1996 tva._render_derived_w_types = self._render_derived_w_types
1997
1998 return tva
1999
2000 def lateral(self, name: Optional[str] = None) -> LateralFromClause:
2001 """Return a new :class:`_sql.TableValuedAlias` with the lateral flag

Callers 1

lateralMethod · 0.95

Calls 1

_constructMethod · 0.45

Tested by

no test coverage detected