| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Thanks to let me know |
Sorry, something went wrong.
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. |
Sorry, something went wrong.
There was a problem hiding this comment.
Looks interesting!
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.
Implementation and tests look good to me.
We may want to describe this in docs, but maybe it's better to wait for Sebastian to validate the idea first
Sorry, something went wrong.
|
I like this |
Sorry, something went wrong.
|
I think they could create a sa_type that stores the value in the database; the SQL type will be determined by mapping it. Alternatively, you could reuse sqlmodel.Enum and add a parameter to make it save the value, but that would imply that it determines the value through class introspection. |
Sorry, something went wrong.
|
This pull request has a merge conflict that needs to be resolved. |
Sorry, something went wrong.
Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
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.
| Back | FazBrowse Home | New Git URL |
I add a IntEnum type decorator which I used in my private project.
I wish it helps!