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

Method alias

lib/sqlalchemy/sql/selectable.py:3956–3973  ·  view source on GitHub ↗

Return a named subquery against this :class:`_expression.SelectBase`. For a :class:`_expression.SelectBase` (as opposed to a :class:`_expression.FromClause`), this returns a :class:`.Subquery` object which behaves mostly the same as the :class:`_expression.Al

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

Source from the content-addressed store, hash-verified

3954 raise NotImplementedError()
3955
3956 def alias(
3957 self, name: Optional[str] = None, flat: bool = False
3958 ) -> Subquery:
3959 """Return a named subquery against this
3960 :class:`_expression.SelectBase`.
3961
3962 For a :class:`_expression.SelectBase` (as opposed to a
3963 :class:`_expression.FromClause`),
3964 this returns a :class:`.Subquery` object which behaves mostly the
3965 same as the :class:`_expression.Alias` object that is used with a
3966 :class:`_expression.FromClause`.
3967
3968 .. versionchanged:: 1.4 The :meth:`_expression.SelectBase.alias`
3969 method is now
3970 a synonym for the :meth:`_expression.SelectBase.subquery` method.
3971
3972 """
3973 return self.subquery(name=name)
3974
3975
3976_SB = TypeVar("_SB", bound=SelectBase)

Callers

nothing calls this directly

Calls 1

subqueryMethod · 0.95

Tested by

no test coverage detected