adonmo / mobilitydb-sqlalchemy

MobilityDB extensions for SQLAlchemy
https://mobilitydb-sqlalchemy.readthedocs.io/en/latest/
MIT License
16 stars 4 forks source link

Implement Range Types #3

Closed chaitan94 closed 4 years ago

chaitan94 commented 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.

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)

chaitan94 commented 4 years ago

Added support for RangeInt in a43205cb25c76868e3e237a06eeaa1e0b78e0c78 and RangeFloat in 40c2944344e0ba78d9211e69b03a75545ffc3e96