Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Increase number_of_types to 8 to support longer select queries #1326

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion sqlmodel/sql/_expression_select_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

from sqlalchemy import (
Column,
Label,
)
from sqlalchemy.sql.elements import (
SQLCoreOperations,
Expand All @@ -40,6 +41,7 @@
Column, # type: ignore
Sequence, # type: ignore
Mapping, # type: ignore
Label, # type: ignore
UUID,
datetime,
float,
Expand All @@ -58,6 +60,7 @@
Column, # type: ignore
Sequence, # type: ignore
Mapping, # type: ignore
Label, # type: ignore
UUID,
datetime,
float,
Expand All @@ -76,6 +79,7 @@
Column, # type: ignore
Sequence, # type: ignore
Mapping, # type: ignore
Label, # type: ignore
UUID,
datetime,
float,
Expand All @@ -94,6 +98,7 @@
Column, # type: ignore
Sequence, # type: ignore
Mapping, # type: ignore
Label, # type: ignore
UUID,
datetime,
float,
Expand All @@ -111,14 +116,25 @@


@overload
def select(__ent0: _TCCA[_T0]) -> SelectOfScalar[_T0]: ...
def select(__ent0: _TCCA[_T0]) -> SelectOfScalar[_T0]: # type: ignore
...


@overload
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


Expand Down
15 changes: 14 additions & 1 deletion sqlmodel/sql/_expression_select_gen.py.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ from uuid import UUID

from sqlalchemy import (
Column,
Label,
)
from sqlalchemy.sql.elements import (
SQLCoreOperations,
Expand All @@ -39,6 +40,7 @@ _TScalar_{{ i }} = TypeVar(
Column, # type: ignore
Sequence, # type: ignore
Mapping, # type: ignore
Label, # type: ignore
UUID,
datetime,
float,
Expand All @@ -56,14 +58,25 @@ _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
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 %}
Expand Down