-
-
Notifications
You must be signed in to change notification settings - Fork 767
✨ Add IntEnum for sqltypes #1337
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
base: main
Are you sure you want to change the base?
Conversation
…nto feat/IntEnum
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KunxiSun, thanks for your interest and efforts!
I think this feature is quite useful.
There seems to be no simple solution to configure int enums this way without creating custom TypeDecorator
. This PR will provide such solution.
Please take a look at my in-code comments.
Also, we need to update these tests to check statements for new field
Co-authored-by: Motov Yurii <[email protected]>
Updates the `IntEnum` SQLAlchemy type to `SmallInteger`. This change reduces the storage size required for `IntEnum` columns when the full range of `Integer` is not needed.
Adds tests to ensure that integer enum fields are correctly handled in both Postgres and SQLite DDL generation.
Thanks for your code suggestion. I also changed the type from Integer to Small Integer, cuz I think the size of Integer is too large to be needed. |
I add a IntEnum type decorator which I used in my private project.
I wish it helps!