Skip to content

Commit 517f8c1

Browse files
Skip logging queries
Fixes #287 CursorDebugWrapper already adds an entry to the queries_log post-execution: https://github.com/django/django/blob/main/django/db/backends/utils.py#L145-L150
1 parent 871c1c8 commit 517f8c1

File tree

1 file changed

+0
-4
lines changed
  • python/sqlcommenter-python/google/cloud/sqlcommenter/django

1 file changed

+0
-4
lines changed

python/sqlcommenter-python/google/cloud/sqlcommenter/django/middleware.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,4 @@ def __call__(self, execute, sql, params, many, context):
9090
# * https://github.com/basecamp/marginalia/issues/61
9191
# * https://github.com/basecamp/marginalia/pull/80
9292

93-
# Add the query to the query log if debugging.
94-
if isinstance(context['cursor'], CursorDebugWrapper):
95-
context['connection'].queries_log.append(sql)
96-
9793
return execute(sql, params, many, context)

0 commit comments

Comments
 (0)