Skip to content

Change the SQL panel to show the select and explain buttons for all queries - #2393

Merged
matthiask merged 2 commits into
django-commons:mainfrom
matthiask:2305-sel-expl-on-all-sql-queries
Jun 16, 2026
Merged

Change the SQL panel to show the select and explain buttons for all queries#2393
matthiask merged 2 commits into
django-commons:mainfrom
matthiask:2305-sel-expl-on-all-sql-queries

Conversation

@matthiask

@matthiask matthiask commented Jun 16, 2026

Copy link
Copy Markdown
Member

Description

Previously, the buttons were only shown for SELECT queries. Since we do not accept
SQL from the client we can securely re-run DML queries too.

Fixes #2305

Checklist:

  • I have added the relevant tests for this change.
  • I have added an item to the Pending section of docs/changes.rst.

AI/LLM Usage

  • This PR includes code generated with the help of an AI/LLM

@github-actions

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  debug_toolbar/panels/sql
  forms.py 25
  panel.py
  utils.py
Project Total  

This report was generated by python-coverage-comment-action

@tim-schilling tim-schilling left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I didn't even realize that all disappears. That's neat.

@matthiask
matthiask merged commit 7475cf0 into django-commons:main Jun 16, 2026
29 checks passed
matthiask added a commit to matthiask/django-debug-toolbar that referenced this pull request Jun 16, 2026
* origin/main:
  Change the SQL panel to show the select and explain buttons for all queries (django-commons#2393)
@matthiask

Copy link
Copy Markdown
Member Author

Oh, I didn't even realize that all disappears. That's neat.

It didn't bother me too much but I'll definitely use the new facility to debug CTE queries!

@matthiask
matthiask deleted the 2305-sel-expl-on-all-sql-queries branch June 16, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing SQL action buttons for comments and CTEs

2 participants