This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use: wrap methods: | |
# @breakpoint_on_query() | |
# Or use as `with breakpoint_on_query():` | |
from contextlib import contextmanager | |
@contextmanager | |
def breakpoint_on_query(): | |
from django.db import connection | |
def instrument(execute, sql, params, many, context): | |
# Optional: match only specific queries, e.g. |
OlderNewer