diff options
| author | Rob Hudson | 2009-09-11 18:29:02 -0700 |
|---|---|---|
| committer | Rob Hudson | 2009-09-11 18:29:02 -0700 |
| commit | 86b7d54760fa1e682552d8aa2c9570c1848c5431 (patch) | |
| tree | 82d60d07e49bf1c694c337789c5b2cc43d8947e5 | |
| parent | dd7bb2c0e0b7001257214b3f219c39894cb96a4c (diff) | |
| download | django-debug-toolbar-86b7d54760fa1e682552d8aa2c9570c1848c5431.tar.bz2 | |
Added more SQL keywords.
| -rw-r--r-- | debug_toolbar/panels/sql.py | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/debug_toolbar/panels/sql.py b/debug_toolbar/panels/sql.py index 244905b..17f4598 100644 --- a/debug_toolbar/panels/sql.py +++ b/debug_toolbar/panels/sql.py @@ -20,15 +20,45 @@ socketserver_path = os.path.realpath(os.path.dirname(SocketServer.__file__)) # 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): |
