@@ -11,6 +11,7 @@ from .. import util
1111from ..engine import Engine , Connection , Connectable
1212from ..engine .url import URL
1313from .compiler import DDLCompiler
14+ from .expression import FunctionElement
1415import threading
1516
1617_T = TypeVar ('_T' )
@@ -90,25 +91,38 @@ class Column(SchemaItem, ColumnClause[_T]):
9091 def __init__ (self , name : str , type_ : Type [TypeEngine [_T ]], * args : Any , autoincrement : Union [bool , str ] = ...,
9192 default : Any = ..., doc : str = ..., key : str = ..., index : bool = ..., info : Mapping [str , Any ] = ...,
9293 nullable : bool = ..., onupdate : Any = ..., primary_key : bool = ..., server_default : Any = ...,
93- server_onupdate : FetchedValue = ..., quote : Optional [bool ] = ..., unique : bool = ...,
94+ server_onupdate : Union [ FetchedValue , FunctionElement ] = ..., quote : Optional [bool ] = ..., unique : bool = ...,
9495 system : bool = ..., comment : str = ...) -> None : ...
9596 @overload
9697 def __init__ (self , type_ : Type [TypeEngine [_T ]], * args : Any , autoincrement : Union [bool , str ] = ...,
9798 default : Any = ..., doc : str = ..., key : str = ..., index : bool = ..., info : Mapping [str , Any ] = ...,
9899 nullable : bool = ..., onupdate : Any = ..., primary_key : bool = ..., server_default : Any = ...,
99- server_onupdate : FetchedValue = ..., quote : Optional [bool ] = ..., unique : bool = ...,
100+ server_onupdate : Union [ FetchedValue , FunctionElement ] = ..., quote : Optional [bool ] = ..., unique : bool = ...,
100101 system : bool = ..., comment : str = ...) -> None : ...
101102 @overload
102103 def __init__ (self , name : str , type_ : TypeEngine [_T ], * args : Any , autoincrement : Union [bool , str ] = ...,
103104 default : Any = ..., doc : str = ..., key : str = ..., index : bool = ..., info : Mapping [str , Any ] = ...,
104105 nullable : bool = ..., onupdate : Any = ..., primary_key : bool = ..., server_default : Any = ...,
105- server_onupdate : FetchedValue = ..., quote : Optional [bool ] = ..., unique : bool = ...,
106+ server_onupdate : Union [ FetchedValue , FunctionElement ] = ..., quote : Optional [bool ] = ..., unique : bool = ...,
106107 system : bool = ..., comment : str = ...) -> None : ...
107108 @overload
108109 def __init__ (self , type_ : TypeEngine [_T ], * args : Any , autoincrement : Union [bool , str ] = ...,
109110 default : Any = ..., doc : str = ..., key : str = ..., index : bool = ..., info : Mapping [str , Any ] = ...,
110111 nullable : bool = ..., onupdate : Any = ..., primary_key : bool = ..., server_default : Any = ...,
111- server_onupdate : FetchedValue = ..., quote : Optional [bool ] = ..., unique : bool = ...,
112+ server_onupdate : Union [FetchedValue , FunctionElement ] = ..., quote : Optional [bool ] = ..., unique : bool = ...,
113+ system : bool = ..., comment : str = ...) -> None : ...
114+ # The two overloads below exist to make annotation more like a cast. This is a temporary measure.
115+ @overload
116+ def __init__ (self , name : str , type_ : Any , * args : Any , autoincrement : Union [bool , str ] = ...,
117+ default : Any = ..., doc : str = ..., key : str = ..., index : bool = ..., info : Mapping [str , Any ] = ...,
118+ nullable : bool = ..., onupdate : Any = ..., primary_key : bool = ..., server_default : Any = ...,
119+ server_onupdate : Union [FetchedValue , FunctionElement ] = ..., quote : Optional [bool ] = ..., unique : bool = ...,
120+ system : bool = ..., comment : str = ...) -> None : ...
121+ @overload
122+ def __init__ (self , type_ : Any , * args : Any , autoincrement : Union [bool , str ] = ...,
123+ default : Any = ..., doc : str = ..., key : str = ..., index : bool = ..., info : Mapping [str , Any ] = ...,
124+ nullable : bool = ..., onupdate : Any = ..., primary_key : bool = ..., server_default : Any = ...,
125+ server_onupdate : Union [FetchedValue , FunctionElement ] = ..., quote : Optional [bool ] = ..., unique : bool = ...,
112126 system : bool = ..., comment : str = ...) -> None : ...
113127 def references (self , column : Column [Any ]) -> bool : ...
114128 def append_foreign_key (self , fk : ForeignKey ) -> None : ...
0 commit comments