Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling explain() causes a syntax error #650

Open
mapavia opened this issue Mar 13, 2023 · 1 comment
Open

Calling explain() causes a syntax error #650

mapavia opened this issue Mar 13, 2023 · 1 comment

Comments

@mapavia
Copy link

mapavia commented Mar 13, 2023

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

@stereodamage
Copy link

Possible duplicate of #597

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants