Skip to content

Commit

Permalink
Added more SQL keywords.
Browse files Browse the repository at this point in the history
  • Loading branch information
robhudson committed Sep 12, 2009
1 parent dd7bb2c commit 86b7d54
Showing 1 changed file with 34 additions and 4 deletions.
38 changes: 34 additions & 4 deletions debug_toolbar/panels/sql.py
Expand Up @@ -20,15 +20,45 @@
# get a copy of the toolbar object with access to its config dictionary
SQL_WARNING_THRESHOLD = getattr(settings, 'DEBUG_TOOLBAR_CONFIG', {}).get('SQL_WARNING_THRESHOLD', 500)

# Note: This isn't intended to catch ALL possible SQL keywords, just a good common set.
# Note: Subsets are listed last to avoid matching a subset of a keyword. This
# whole thing could be greatly improved but for now this works.
SQL_KEYWORDS = (
'SELECT',
'ALTER',
'AND',
'ASC',
'AS',
'AVG',
'COUNT',
'CREATE',
'DESC',
'DELETE',
'DISTINCT',
'DROP',
'FROM',
'WHERE',
'GROUP BY',
'HAVING',
'INNER JOIN',
'INSERT',
'IN',
'LEFT OUTER JOIN',
'LIKE',
'LIMIT',
'MAX',
'MIN',
'OFFSET',
'ON',
'ORDER BY',
'HAVING',
'GROUP BY',
'OR',
'SELECT',
'SET',
'STDDEV_POP',
'STDDEV_SAMP',
'SUM',
'UPDATE',
'VAR_POP',
'VAR_SAMP',
'WHERE',
)

def tidy_stacktrace(strace):
Expand Down

0 comments on commit 86b7d54

Please sign in to comment.