Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better support for ENUMs #12

Open
OliverHofkens opened this issue Feb 25, 2022 · 1 comment
Open

Better support for ENUMs #12

OliverHofkens opened this issue Feb 25, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@OliverHofkens
Copy link
Member

SQLAlchemy offers great support for ENUM fields, mapping them from either a list of options or a Python Enum.
OData-Query doesn't utilize this feature well enough, and currently just crashes if you try to use a non-existing ENUM member.

@OliverHofkens OliverHofkens self-assigned this Feb 25, 2022
@OliverHofkens OliverHofkens added the enhancement New feature or request label Feb 25, 2022
@OliverHofkens
Copy link
Member Author

This is partially solved in SQLAlchemy by passing validate_strings=True to the ENUM definition, which will raise LookupError when an unknown enum member is used. So this might not be our concern.

One adjacent feature that would be cool is supporting OData's enum type, which uses syntax like status eq PostStatus'DRAFT'.

@OliverHofkens OliverHofkens changed the title Better support for database ENUM fields in SQLAlchemy Better support for ENUMs Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant