MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / label

Method label

lib/sqlalchemy/orm/query.py:737–752  ·  view source on GitHub ↗

Return the full SELECT statement represented by this :class:`_query.Query`, converted to a scalar subquery with a label of the given name. .. seealso:: :meth:`_sql.Select.label` - v2 comparable method.

(self, name: Optional[str])

Source from the content-addressed store, hash-verified

735 )
736
737 def label(self, name: Optional[str]) -> Label[Any]:
738 """Return the full SELECT statement represented by this
739 :class:`_query.Query`, converted
740 to a scalar subquery with a label of the given name.
741
742 .. seealso::
743
744 :meth:`_sql.Select.label` - v2 comparable method.
745
746 """
747
748 return (
749 self.enable_eagerloads(False)
750 ._get_select_statement_only()
751 .label(name)
752 )
753
754 @overload
755 def as_scalar( # type: ignore[overload-overlap]

Callers

nothing calls this directly

Calls 2

enable_eagerloadsMethod · 0.95

Tested by

no test coverage detected