]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
do not convert uuid to string in postgresql and mssql
authorFederico Caselli <cfederico87@gmail.com>
Mon, 18 Mar 2024 21:01:00 +0000 (22:01 +0100)
committerFederico Caselli <cfederico87@gmail.com>
Mon, 18 Mar 2024 21:01:00 +0000 (22:01 +0100)
Change-Id: Ic3c87d8c654926f7ef28ba9ec6dd21c50a1171cf

doc/build/core/custom_types.rst

index 90fc5031861d57025b2bc8044ac0d59be02f2355..5390824dda8cebea80afc167e3af496d5e0a7eaa 100644 (file)
@@ -212,10 +212,8 @@ string, using a CHAR(36) type::
                 return dialect.type_descriptor(self._default_type)
 
         def process_bind_param(self, value, dialect):
-            if value is None:
+            if value is None or dialect.name in ("postgresql", "mssql"):
                 return value
-            elif dialect.name in ("postgresql", "mssql"):
-                return str(value)
             else:
                 if not isinstance(value, uuid.UUID):
                     value = uuid.UUID(value)