We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4901d68 commit 70488fcCopy full SHA for 70488fc
flask_debugtoolbar/panels/sqlalchemy.py
@@ -21,8 +21,13 @@ def query_signer():
21
salt='fdt-sql-query')
22
23
24
+def is_select(statement):
25
+ prefix = b'select' if isinstance(statement, bytes) else 'select'
26
+ return statement.lower().strip().startswith(prefix)
27
+
28
29
def dump_query(statement, params):
- if not params or not statement.lower().strip().startswith('select'):
30
+ if not params or not is_select(statement):
31
return None
32
33
try:
@@ -38,7 +43,7 @@ def load_query(data):
38
43
abort(406)
39
44
40
45
# Make sure it is a select statement
41
- if not statement.lower().strip().startswith('select'):
46
+ if not is_select(statement):
42
47
48
49
return statement, params
0 commit comments