class Emulated(object):
Known subclasses: sqlalchemy.types.Boolean
, sqlalchemy.types.Enum
, sqlalchemy.types.Interval
Mixin for base types that emulate the behavior of a DB-native type.
An .Emulated
type will use an available database type
in conjunction with Python-side routines and/or database constraints
in order to approximate the behavior of a database type that is provided
natively by some backends. When a native-providing backend is in
use, the native version of the type is used. This native version
should include the .NativeForEmulated
mixin to allow it to be
distinguished from .Emulated
.
Current examples of .Emulated
are: .Interval
,
.Enum
, .Boolean
.
Method | adapt |
Undocumented |
Method | adapt_to_emulated |
Given an impl class, adapt this type to the impl assuming "emulated". |
sqlalchemy.types.Enum
, sqlalchemy.types.Interval
Given an impl class, adapt this type to the impl assuming "emulated".
The impl should also be an "emulated" version of this type, most likely the same class as this type itself.
e.g.: sqltypes.Enum adapts to the Enum class.