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])
| 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] |
nothing calls this directly
no test coverage detected