Skip to content

Commit

Permalink
Add CTE prefixes (#157)
Browse files Browse the repository at this point in the history
sqlalchemy/sqlalchemy#5043 added support for CTE prefix clauses in PostgreSQL 12. This PR fixes the dreadful `"CTE" has no attribute "prefix_with"` error for me.
  • Loading branch information
tuffnatty authored Jan 8, 2021
1 parent c748ba3 commit b3c1613
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sqlalchemy-stubs/sql/selectable.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,12 @@ class TableSample(Alias):
def __init__(self, selectable: FromClause, sampling: Union[float, Function[float]], name: Optional[str] = ...,
seed: Optional[Any] = ...) -> None: ...

class CTE(Generative, HasSuffixes, Alias):
class CTE(Generative, HasPrefixes, HasSuffixes, Alias):
__visit_name__: str = ...
recursive: bool = ...
def __init__(self, selectable: Select, name: Optional[str] = ..., recursive: bool = ...,
_cte_alias: Optional[Any] = ..., _restates: Any = ..., _suffixes: Optional[Any] = ...) -> None: ...
_cte_alias: Optional[Any] = ..., _restates: Any = ..., _prefixes: Optional[Any] = ...,
_suffixes: Optional[Any] = ...) -> None: ...
def alias(self, name: Optional[str] = ..., flat: bool = ...) -> CTE: ...
def union(self, other: Select) -> CTE: ...
def union_all(self, other: Select) -> CTE: ...
Expand Down

0 comments on commit b3c1613

Please sign in to comment.