@@ -29,6 +29,7 @@ from .elements import ClauseElement
2929from .elements import ColumnClause
3030from .elements import ColumnElement
3131from .elements import TextClause
32+ from .functions import FunctionElement
3233from .events import DDLEvents
3334from .selectable import TableClause
3435from .. import util
@@ -54,6 +55,9 @@ _IDX = TypeVar("_IDX", bound=Index)
5455_CP = TypeVar ("_CP" , bound = Computed )
5556_ID = TypeVar ("_ID" , bound = Identity )
5657
58+ _ServerDefaultType = Union [FetchedValue , str , TextClause , ColumnElement [_T ]]
59+ _ServerOnUpdateType = Union [FetchedValue , FunctionElement ]
60+
5761class SchemaItem (SchemaEventTarget , visitors .Visitable ):
5862 __visit_name__ : str = ...
5963 create_drop_stringify_dialect : str = ...
@@ -140,10 +144,8 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_TE]):
140144 primary_key : bool = ...
141145 nullable : bool = ...
142146 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 ] = ...
147149 index : Optional [bool ] = ...
148150 unique : Optional [bool ] = ...
149151 system : bool = ...
@@ -169,10 +171,8 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_TE]):
169171 nullable : bool = ...,
170172 onupdate : Optional [Any ] = ...,
171173 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 ] = ...,
176176 quote : Optional [bool ] = ...,
177177 unique : Optional [bool ] = ...,
178178 system : bool = ...,
@@ -192,10 +192,8 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_TE]):
192192 nullable : bool = ...,
193193 onupdate : Optional [Any ] = ...,
194194 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 ] = ...,
199197 quote : Optional [bool ] = ...,
200198 unique : Optional [bool ] = ...,
201199 system : bool = ...,
@@ -217,10 +215,8 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_TE]):
217215 nullable : bool = ...,
218216 onupdate : Optional [Any ] = ...,
219217 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 ] = ...,
224220 quote : Optional [bool ] = ...,
225221 unique : Optional [bool ] = ...,
226222 system : bool = ...,
@@ -241,10 +237,8 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_TE]):
241237 nullable : bool = ...,
242238 onupdate : Optional [Any ] = ...,
243239 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 ] = ...,
248242 quote : Optional [bool ] = ...,
249243 unique : Optional [bool ] = ...,
250244 system : bool = ...,
0 commit comments