You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if the sql logger would quote params in the printed queries to make it easier to copy/paste into a CLI client for closer optimization/examination.
Eg instead of:
sql SELECT ...
FROM foo
WHERE foo.name = bob sql Found 1 matching rows
it would print:
sql SELECT ...
FROM foo
WHERE foo.name = "bob" sql Found 1 matching rows
The text was updated successfully, but these errors were encountered:
In addition to making this easier to reuse, it would fix an actual bug in the display where data values are processed as if they're part of the actual query:
NATIONAL-archives-AND-records-administration
instead of:
'national-archives-and-records-administration'
acdha
added a commit
to acdha/django-devserver
that referenced
this issue
Nov 7, 2012
Previously string values were not quoted, causing sqlparse to interpret them as
code. Any value which matched a SQL keyword would be capitalized and indented,
causing garbled display of queries containing text like 'of', 'and', 'key',
'limit', etc.
django.db.backends.BaseDatabaseOperations has a helpful last_executed_query
method which expands query placeholders (django-debug-toolbar also uses this)
reliably. This commit changes the SQL realtime module to use last_executed_query
and to perform the formatting after the actual query executes to match the
expected semantics.
Closesdcramer#13
acdha
linked a pull request
Nov 7, 2012
that will
close
this issue
It would be nice if the sql logger would quote params in the printed queries to make it easier to copy/paste into a CLI client for closer optimization/examination.
Eg instead of:
sql SELECT ...
FROM
foo
WHERE
foo
.name
= bobsql Found 1 matching rows
it would print:
sql SELECT ...
FROM
foo
WHERE
foo
.name
= "bob"sql Found 1 matching rows
The text was updated successfully, but these errors were encountered: