Skip to content

Commit d05f112

Browse files
BlackLIonzCaselIT
andauthored
212-Add typings (#213)
* 212-Add typings * 212-Add typings for classes * Minor refactoring * run zimports Co-authored-by: Federico Caselli <cfederico87@gmail.com>
1 parent d29a7a0 commit d05f112

File tree

1 file changed

+27
-15
lines changed
  • sqlalchemy-stubs/dialects/postgresql

1 file changed

+27
-15
lines changed
Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,40 @@
11
from typing import Any
2+
from typing import Mapping
23
from typing import Optional
4+
from typing import Sequence
5+
from typing import Union
36

7+
from . import ExcludeConstraint
8+
from ... import Column
9+
from ... import Constraint
10+
from ... import Index
411
from ... import util as util
512
from ...sql.dml import Insert as StandardInsert
613
from ...sql.elements import ClauseElement
14+
from ...sql.elements import ColumnElement
15+
from ...sql.functions import GenericFunction
16+
717

818
class Insert(StandardInsert):
919
stringify_dialect: str = ...
1020
@util.memoized_property
1121
def excluded(self): ...
22+
1223
def on_conflict_do_update(
1324
self,
14-
constraint: Optional[Any] = ...,
15-
index_elements: Optional[Any] = ...,
16-
index_where: Optional[Any] = ...,
17-
set_: Optional[Any] = ...,
18-
where: Optional[Any] = ...,
19-
) -> None: ...
25+
constraint: Optional[Union[str, Index, Constraint, ExcludeConstraint]] = ...,
26+
index_elements: Sequence[Union[str, Column]] = ...,
27+
index_where: Optional[ClauseElement] = ...,
28+
set_: Mapping[str, Union[ColumnElement, GenericFunction]] = ...,
29+
where: Optional[ClauseElement] = ...,
30+
) -> 'Insert': ...
31+
2032
def on_conflict_do_nothing(
2133
self,
22-
constraint: Optional[Any] = ...,
23-
index_elements: Optional[Any] = ...,
34+
constraint: Optional[Union[str, Index, Constraint, ExcludeConstraint]] = ...,
35+
index_elements: Optional[Sequence[Union[str, Column]]] = ...,
2436
index_where: Optional[Any] = ...,
25-
) -> None: ...
37+
) -> 'Index': ...
2638

2739
insert: Any
2840

@@ -33,8 +45,8 @@ class OnConflictClause(ClauseElement):
3345
inferred_target_whereclause: Any = ...
3446
def __init__(
3547
self,
36-
constraint: Optional[Any] = ...,
37-
index_elements: Optional[Any] = ...,
48+
constraint: Optional[Union[str, Index, Constraint, ExcludeConstraint]] = ...,
49+
index_elements: Optional[Sequence[Union[str, Column]]] = ...,
3850
index_where: Optional[Any] = ...,
3951
) -> None: ...
4052

@@ -47,9 +59,9 @@ class OnConflictDoUpdate(OnConflictClause):
4759
update_whereclause: Any = ...
4860
def __init__(
4961
self,
50-
constraint: Optional[Any] = ...,
51-
index_elements: Optional[Any] = ...,
62+
constraint: Optional[Union[str, Index, Constraint, ExcludeConstraint]] = ...,
63+
index_elements: Optional[Sequence[Union[str, Column]]] = ...,
5264
index_where: Optional[Any] = ...,
53-
set_: Optional[Any] = ...,
54-
where: Optional[Any] = ...,
65+
set_: Mapping[str, Union[ColumnElement, GenericFunction]] = ...,
66+
where: Optional[ClauseElement] = ...,
5567
) -> None: ...

0 commit comments

Comments
 (0)