@@ -29,6 +29,7 @@ from .elements import ClauseElement
29
29
from .elements import ColumnClause
30
30
from .elements import ColumnElement
31
31
from .elements import TextClause
32
+ from .functions import FunctionElement
32
33
from .events import DDLEvents
33
34
from .selectable import TableClause
34
35
from .. import util
@@ -54,6 +55,9 @@ _IDX = TypeVar("_IDX", bound=Index)
54
55
_CP = TypeVar ("_CP" , bound = Computed )
55
56
_ID = TypeVar ("_ID" , bound = Identity )
56
57
58
+ _ServerDefaultType = Union [FetchedValue , str , TextClause , ColumnElement [_T ]]
59
+ _ServerOnUpdateType = Union [FetchedValue , FunctionElement ]
60
+
57
61
class SchemaItem (SchemaEventTarget , visitors .Visitable ):
58
62
__visit_name__ : str = ...
59
63
create_drop_stringify_dialect : str = ...
@@ -140,10 +144,8 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_TE]):
140
144
primary_key : bool = ...
141
145
nullable : bool = ...
142
146
default : Optional [Any ] = ...
143
- server_default : Optional [
144
- Union [FetchedValue , str , TextClause , ColumnElement [_TE ]]
145
- ] = ...
146
- server_onupdate : Optional [FetchedValue ] = ...
147
+ server_default : Optional [_ServerDefaultType [_TE ]] = ...
148
+ server_onupdate : Optional [_ServerOnUpdateType ] = ...
147
149
index : Optional [bool ] = ...
148
150
unique : Optional [bool ] = ...
149
151
system : bool = ...
@@ -169,10 +171,8 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_TE]):
169
171
nullable : bool = ...,
170
172
onupdate : Optional [Any ] = ...,
171
173
primary_key : bool = ...,
172
- server_default : Optional [
173
- Union [FetchedValue , str , TextClause , ColumnElement [Any ]]
174
- ] = ...,
175
- server_onupdate : Optional [FetchedValue ] = ...,
174
+ server_default : Optional [_ServerDefaultType [Any ]] = ...,
175
+ server_onupdate : Optional [_ServerOnUpdateType ] = ...,
176
176
quote : Optional [bool ] = ...,
177
177
unique : Optional [bool ] = ...,
178
178
system : bool = ...,
@@ -192,10 +192,8 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_TE]):
192
192
nullable : bool = ...,
193
193
onupdate : Optional [Any ] = ...,
194
194
primary_key : bool = ...,
195
- server_default : Optional [
196
- Union [FetchedValue , str , TextClause , ColumnElement [Any ]]
197
- ] = ...,
198
- server_onupdate : Optional [FetchedValue ] = ...,
195
+ server_default : Optional [_ServerDefaultType [Any ]] = ...,
196
+ server_onupdate : Optional [_ServerOnUpdateType ] = ...,
199
197
quote : Optional [bool ] = ...,
200
198
unique : Optional [bool ] = ...,
201
199
system : bool = ...,
@@ -217,10 +215,8 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_TE]):
217
215
nullable : bool = ...,
218
216
onupdate : Optional [Any ] = ...,
219
217
primary_key : bool = ...,
220
- server_default : Optional [
221
- Union [FetchedValue , str , TextClause , ColumnElement [_TE ]]
222
- ] = ...,
223
- server_onupdate : Optional [FetchedValue ] = ...,
218
+ server_default : Optional [_ServerDefaultType [_TE ]] = ...,
219
+ server_onupdate : Optional [_ServerOnUpdateType ] = ...,
224
220
quote : Optional [bool ] = ...,
225
221
unique : Optional [bool ] = ...,
226
222
system : bool = ...,
@@ -241,10 +237,8 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_TE]):
241
237
nullable : bool = ...,
242
238
onupdate : Optional [Any ] = ...,
243
239
primary_key : bool = ...,
244
- server_default : Optional [
245
- Union [FetchedValue , str , TextClause , ColumnElement [_TE ]]
246
- ] = ...,
247
- server_onupdate : Optional [FetchedValue ] = ...,
240
+ server_default : Optional [_ServerDefaultType [_TE ]] = ...,
241
+ server_onupdate : Optional [_ServerOnUpdateType ] = ...,
248
242
quote : Optional [bool ] = ...,
249
243
unique : Optional [bool ] = ...,
250
244
system : bool = ...,
0 commit comments