core.orm.debug

Classes

Timer

A timer that works just like a stopwatch.

Functions

print_query(→ None)

Pretty prints the given query.

analyze_sql_queries(→ Iterator[None])

Analyzes the sql-queries executed during its context. There are three

Module Contents

class core.orm.debug.Timer[source]

A timer that works just like a stopwatch.

start() None[source]
stop() datetime.timedelta[source]
core.orm.debug.print_query(query: bytes) None[source]

Pretty prints the given query.

core.orm.debug.analyze_sql_queries(report: Literal['summary', 'redundant', 'all'] = 'summary') Iterator[None][source]

Analyzes the sql-queries executed during its context. There are three levels of information (report argument):

  • ‘summary’ (only show the number of queries)

  • ‘redundant’ (show summary and the actual redundant queries)

  • ‘all’ (show summary and all executed queries)

Use this with a with_statement:

with analyze_sql_queries():
    ... # <- analyzes all sql queries that happen inside here