Skip to content

Commit 5ea9340

Browse files
✨ Update GUID handling to use stdlib UUID.hex instead of an int (#26)
Co-authored-by: Sebastián Ramírez <[email protected]>
1 parent db3ad59 commit 5ea9340

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sqlmodel/sql/sqltypes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ def process_bind_param(self, value: Any, dialect: Dialect) -> Optional[str]:
4747
return str(value)
4848
else:
4949
if not isinstance(value, uuid.UUID):
50-
return f"{uuid.UUID(value).int:x}"
50+
return uuid.UUID(value).hex
5151
else:
5252
# hexstring
53-
return f"{value.int:x}"
53+
return value.hex
5454

5555
def process_result_value(self, value: Any, dialect: Dialect) -> Optional[uuid.UUID]:
5656
if value is None:

0 commit comments

Comments
 (0)