-
Notifications
You must be signed in to change notification settings - Fork 1.1k
SQL section of toolbar assumes database supports explain #958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Postgres also suppors EXPLAIN. Which database are you referring to? |
SQL Server but I'm sure there are other examples. For instance Oracle might not have that capability and a lot more than MySQL and Postgres are supported by django through ODBC. In fact I'm using django_pyodbc to connect to SQL Server. |
I'm testing django-debug-toolbar 2.0a1 and ran into this issue while using an Oracle backend djdt tries to run : QUERY = 'EXPLAIN SELECT.... |
Django has some support for Or maybe insert an additional clause here: https://github.com/jazzband/django-debug-toolbar/blob/58f374a426a6b10dcf86554f6d9c71226b4b350f/debug_toolbar/panels/sql/views.py#L47-L55 -- that should work too and is probably a smaller change. |
@matthiask Definitely, if Django does the abstraction for you, then that's the way to go. |
The SQL section of the toolbar assumes that the database supports explain (probably MySQL is being assumed) and attempts to run the SQL query with explain which results in a 500 error. The toolbar should check the driver before making any such assumptions.
The text was updated successfully, but these errors were encountered: