[Bugfix] Fixed an issue with UUID type queries in MySQL databases (#28941)

This commit is contained in:
carribean 2025-12-02 14:37:23 +08:00 committed by GitHub
parent 8e5cb86409
commit 369892634d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -19,7 +19,7 @@ class StringUUID(TypeDecorator[uuid.UUID | str | None]):
def process_bind_param(self, value: uuid.UUID | str | None, dialect: Dialect) -> str | None:
if value is None:
return value
elif dialect.name == "postgresql":
elif dialect.name in ["postgresql", "mysql"]:
return str(value)
else:
if isinstance(value, uuid.UUID):