diff --git a/sqlmodel/sql/_expression_select_gen.py b/sqlmodel/sql/_expression_select_gen.py index 08aa59ad61..625df4e971 100644 --- a/sqlmodel/sql/_expression_select_gen.py +++ b/sqlmodel/sql/_expression_select_gen.py @@ -15,6 +15,7 @@ from sqlalchemy import ( Column, + Label, ) from sqlalchemy.sql.elements import ( SQLCoreOperations, @@ -40,6 +41,7 @@ Column, # type: ignore Sequence, # type: ignore Mapping, # type: ignore + Label, # type: ignore UUID, datetime, float, @@ -58,6 +60,7 @@ Column, # type: ignore Sequence, # type: ignore Mapping, # type: ignore + Label, # type: ignore UUID, datetime, float, @@ -76,6 +79,7 @@ Column, # type: ignore Sequence, # type: ignore Mapping, # type: ignore + Label, # type: ignore UUID, datetime, float, @@ -94,6 +98,7 @@ Column, # type: ignore Sequence, # type: ignore Mapping, # type: ignore + Label, # type: ignore UUID, datetime, float, @@ -111,7 +116,8 @@ @overload -def select(__ent0: _TCCA[_T0]) -> SelectOfScalar[_T0]: ... +def select(__ent0: _TCCA[_T0]) -> SelectOfScalar[_T0]: # type: ignore + ... @overload @@ -119,6 +125,16 @@ def select(__ent0: _TScalar_0) -> SelectOfScalar[_TScalar_0]: # type: ignore ... +@overload +def select(*entities: _TCCA[_T0]) -> Select[Tuple[_T0, ...]]: # type: ignore + ... + + +@overload +def select(*entities: _TScalar_0) -> Select[Tuple[_TScalar_0, ...]]: # type: ignore + ... + + # Generated overloads start diff --git a/sqlmodel/sql/_expression_select_gen.py.jinja2 b/sqlmodel/sql/_expression_select_gen.py.jinja2 index ef838e4168..319ec642c9 100644 --- a/sqlmodel/sql/_expression_select_gen.py.jinja2 +++ b/sqlmodel/sql/_expression_select_gen.py.jinja2 @@ -13,6 +13,7 @@ from uuid import UUID from sqlalchemy import ( Column, + Label, ) from sqlalchemy.sql.elements import ( SQLCoreOperations, @@ -39,6 +40,7 @@ _TScalar_{{ i }} = TypeVar( Column, # type: ignore Sequence, # type: ignore Mapping, # type: ignore + Label, # type: ignore UUID, datetime, float, @@ -56,7 +58,8 @@ _T{{ i }} = TypeVar("_T{{ i }}") # Generated TypeVars end @overload -def select(__ent0: _TCCA[_T0]) -> SelectOfScalar[_T0]: ... +def select(__ent0: _TCCA[_T0]) -> SelectOfScalar[_T0]: # type: ignore + ... @overload @@ -64,6 +67,16 @@ def select(__ent0: _TScalar_0) -> SelectOfScalar[_TScalar_0]: # type: ignore ... +@overload +def select(*entities: _TCCA[_T0]) -> Select[Tuple[_T0, ...]]: # type: ignore + ... + + +@overload +def select(*entities: _TScalar_0) -> Select[Tuple[_TScalar_0, ...]]: # type: ignore + ... + + # Generated overloads start {% for signature in signatures %}