We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c33ce08 commit 8ef3b8cCopy full SHA for 8ef3b8c
debug_toolbar/panels/sql/tracking.py
@@ -98,10 +98,10 @@ def _decode(self, param):
98
except UnicodeDecodeError:
99
return '(encoded string)'
100
101
- def execute(self, sql, params=()):
+ def _record(self, method, sql, params):
102
start_time = time()
103
try:
104
- return self.cursor.execute(sql, params)
+ return method(sql, params)
105
finally:
106
stop_time = time()
107
duration = (stop_time - start_time) * 1000
@@ -171,8 +171,11 @@ def execute(self, sql, params=()):
171
# We keep `sql` to maintain backwards compatibility
172
self.logger.record(**params)
173
174
+ def execute(self, sql, params=()):
175
+ return self._record(self.cursor.execute, sql, params)
176
+
177
def executemany(self, sql, param_list):
- return self.cursor.executemany(sql, param_list)
178
+ return self._record(self.cursor.executemany, sql, param_list)
179
180
def __getattr__(self, attr):
181
return getattr(self.cursor, attr)
0 commit comments