Closed chaitan94 closed 4 years ago
For each of the range types defined in MobilityDB, a class that extends SQLAlchemy's UserDefinedType needs to be defined, similar to how we already defined temporal types like TFloat.
UserDefinedType
TFloat
These include:
Check MobilityDB's documentation on Range Types: https://docs.mobilitydb.com/nightly/ch02.html
For details on how UserDefinedType is used to create new column types in SQLAlchemy, refer to: https://docs.sqlalchemy.org/en/13/core/custom_types.html#sqlalchemy.types.UserDefinedType
For an example implementation, check code for TFloat class: https://github.com/adonmo/mobilitydb-sqlalchemy/blob/master/mobilitydb_sqlalchemy/types/TFloat.py (or its base class TBaseType)
TBaseType
Added support for RangeInt in a43205cb25c76868e3e237a06eeaa1e0b78e0c78 and RangeFloat in 40c2944344e0ba78d9211e69b03a75545ffc3e96
For each of the range types defined in MobilityDB, a class that extends SQLAlchemy's
UserDefinedType
needs to be defined, similar to how we already defined temporal types likeTFloat
.These include:
Check MobilityDB's documentation on Range Types: https://docs.mobilitydb.com/nightly/ch02.html
For details on how
UserDefinedType
is used to create new column types in SQLAlchemy, refer to: https://docs.sqlalchemy.org/en/13/core/custom_types.html#sqlalchemy.types.UserDefinedTypeFor an example implementation, check code for
TFloat
class: https://github.com/adonmo/mobilitydb-sqlalchemy/blob/master/mobilitydb_sqlalchemy/types/TFloat.py (or its base classTBaseType
)