1
1
from typing import Any
2
+ from typing import Mapping
2
3
from typing import Optional
4
+ from typing import Sequence
5
+ from typing import Union
3
6
7
+ from . import ExcludeConstraint
8
+ from ... import Column
9
+ from ... import Constraint
10
+ from ... import Index
4
11
from ... import util as util
5
12
from ...sql .dml import Insert as StandardInsert
6
13
from ...sql .elements import ClauseElement
14
+ from ...sql .elements import ColumnElement
15
+ from ...sql .functions import GenericFunction
16
+
7
17
8
18
class Insert (StandardInsert ):
9
19
stringify_dialect : str = ...
10
20
@util .memoized_property
11
21
def excluded (self ): ...
22
+
12
23
def on_conflict_do_update (
13
24
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
+
20
32
def on_conflict_do_nothing (
21
33
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 ]] ] = ...,
24
36
index_where : Optional [Any ] = ...,
25
- ) -> None : ...
37
+ ) -> 'Index' : ...
26
38
27
39
insert : Any
28
40
@@ -33,8 +45,8 @@ class OnConflictClause(ClauseElement):
33
45
inferred_target_whereclause : Any = ...
34
46
def __init__ (
35
47
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 ]] ] = ...,
38
50
index_where : Optional [Any ] = ...,
39
51
) -> None : ...
40
52
@@ -47,9 +59,9 @@ class OnConflictDoUpdate(OnConflictClause):
47
59
update_whereclause : Any = ...
48
60
def __init__ (
49
61
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 ]] ] = ...,
52
64
index_where : Optional [Any ] = ...,
53
- set_ : Optional [ Any ] = ...,
54
- where : Optional [Any ] = ...,
65
+ set_ : Mapping [ str , Union [ ColumnElement , GenericFunction ] ] = ...,
66
+ where : Optional [ClauseElement ] = ...,
55
67
) -> None : ...
0 commit comments