@@ -58,14 +58,6 @@ def log(self, op, duration, args, kwargs=None):
5858 )
5959
6060 def _decode (self , param ):
61- if PostgresJson and isinstance (param , PostgresJson ):
62- # psycopg3
63- if hasattr (param , "obj" ):
64- return param .dumps (param .obj )
65- # psycopg2
66- if hasattr (param , "adapted" ):
67- return param .dumps (param .adapted )
68-
6961 # If a sequence type, decode each element separately
7062 if isinstance (param , (tuple , list )):
7163 return [self ._decode (element ) for element in param ]
@@ -81,19 +73,6 @@ def _decode(self, param):
8173 except UnicodeDecodeError :
8274 return "(encoded string)"
8375
84- def _last_executed_query (self , sql , params ):
85- """Get the last executed query from the connection."""
86- # Django's psycopg3 backend creates a new cursor in its implementation of the
87- # .last_executed_query() method. To avoid wrapping that cursor, temporarily set
88- # the DatabaseWrapper's ._djdt_logger attribute to None. This will cause the
89- # monkey-patched .cursor() and .chunked_cursor() methods to skip the wrapping
90- # process during the .last_executed_query() call.
91- self .db ._djdt_logger = None
92- try :
93- return self .db .ops .last_executed_query (self .cursor , sql , params )
94- finally :
95- self .db ._djdt_logger = self .logger
96-
9776 def _record (self , method , sql , params ):
9877 alias = self .db .alias
9978 vendor = self .db .vendor
0 commit comments