refactor(recorder): Collect PROFILE and EXPLAIN results in a dict
This commit is contained in:
parent
af2c1dc471
commit
3a8606cd1e
1 changed files with 2 additions and 2 deletions
|
|
@ -124,12 +124,12 @@ def recorder(function):
|
|||
# Built in profiler is already turned on
|
||||
# Now fetch the profile data for last query
|
||||
# This must be done after collecting query from _cursor._executed
|
||||
profile_result = function("SHOW PROFILE ALL")
|
||||
profile_result = function("SHOW PROFILE ALL", as_dict=True)
|
||||
|
||||
# Collect EXPLAIN for executed query
|
||||
if query.lower().strip().split()[0] in ("select", "update", "delete"):
|
||||
# Only SELECT/UPDATE/DELETE queries can be "EXPLAIN"ed
|
||||
explain_result = function("EXPLAIN EXTENDED {}".format(query))
|
||||
explain_result = function("EXPLAIN EXTENDED {}".format(query), as_dict=True)
|
||||
else:
|
||||
explain_result = ""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue