Skip to content

Commit a9a45fa

Browse files
KunxiSunKunxiSun
authored andcommitted
update: Uses SmallInteger type for IntEnum
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.
1 parent ea4083d commit a9a45fa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎sqlmodel/sql/sqltypes.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def load_dialect_impl(self, dialect: Dialect) -> "types.TypeEngine[Any]":
6565

6666
_TIntEnum = TypeVar("_TIntEnum", bound="_IntEnum")
6767
class IntEnum(types.TypeDecorator[Optional[_TIntEnum]]):
68-
impl = types.Integer
68+
impl = types.SmallInteger
6969
cache_ok = True
7070

7171
def __init__(self, enum_type: type[_TIntEnum], *args: Any, **kwargs: Any):

0 commit comments

Comments
 (0)