jazzband / django-silk

Silky smooth profiling for Django

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Calling explain() causes a syntax error

mapavia opened this issue · comments

ProgrammingError at /admin/user/user/
syntax error at or near "EXPLAIN"
LINE 1: EXPLAIN EXPLAIN SELECT "user"."password", "user"."is_superus...

Can I explicitly add a check on silk/sql.py if not q.startswith("EXPLAIN"):


        # currently we cannot use explain() method
        # for queries other than `select`
        if not q.startswith("EXPLAIN"):
            prefixed_query = f"{prefix} {q}"
            with connection.cursor() as cur:
                cur.execute(prefixed_query, params)
                result = _unpack_explanation(cur.fetchall())
                return '\n'.join(result)
    return None

I cant seem to push my branch and create a PR. I'm new in contributing so I have no clue if I have permissions

Possible duplicate of #597