Revision 3263
Added by Aaron Marcuse-Kubitza over 12 years ago
sql.py | ||
---|---|---|
542 | 542 |
return re.match(r'^(?:SELECT|INSERT|UPDATE|DELETE|VALUES|EXECUTE|DECLARE)\b' |
543 | 543 |
, query) |
544 | 544 |
|
545 |
def explain(db, query): |
|
545 |
def explain(db, query, **kw_args): |
|
546 |
''' |
|
547 |
For params, see run_query(). |
|
548 |
''' |
|
549 |
kw_args.setdefault('log_level', 3) |
|
550 |
|
|
546 | 551 |
return strings.join_lines(values(run_query(db, 'EXPLAIN '+query, |
547 |
recover=True, cacheable=True, log_level=3)))
|
|
552 |
recover=True, cacheable=True, **kw_args)))
|
|
548 | 553 |
# not a higher log_level because it's useful to see what query is being |
549 | 554 |
# run before it's executed, which EXPLAIN effectively provides |
550 | 555 |
|
Also available in: Unified diff
sql.py: explain(): Support custom log_level