Skip to content

Commit

Permalink
Fix PostgreSQL array type
Browse files Browse the repository at this point in the history
Fixes #188.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Loading branch information
andersk committed Dec 20, 2020
1 parent cd608f4 commit a037c19
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions sqlalchemy-stubs/dialects/postgresql/array.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typing import Any as _AnyType, Optional, TypeVar, Type, Callable, overload
from ...sql import expression
from typing import Any as _AnyType, Optional, Sequence, TypeVar, Type, Union, Callable, overload
from ...sql import ColumnElement, expression
from ...sql.type_api import TypeEngine
from ... import types as _sqltypes

Expand All @@ -8,7 +8,14 @@ _T = TypeVar('_T')
def Any(other: _AnyType, arrexpr: _AnyType, operator: Callable[..., _AnyType] = ...) -> _AnyType: ...
def All(other: _AnyType, arrexpr: _AnyType, operator: Callable[..., _AnyType] = ...) -> _AnyType: ...

class array(expression.Tuple): ...
class array(expression.Tuple[_T]):
def __init__(
self,
clauses: Sequence[Union[_T, ColumnElement[_T]]],
type_: Optional[Union[TypeEngine[_T], Type[TypeEngine[_T]]]] = ...,
**kw: _AnyType,
) -> None: ...

class ARRAY(_sqltypes.ARRAY[_T]):
@overload
def __init__(self, item_type: TypeEngine[_T], as_tuple: bool = ..., dimensions: Optional[_AnyType] = ...,
Expand Down

0 comments on commit a037c19

Please sign in to comment.