MCPcopy
hub / github.com/django/django / explain_query

Method explain_query

django/db/models/sql/compiler.py:1668–1679  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1666 return result
1667
1668 def explain_query(self):
1669 result = list(self.execute_sql())
1670 # Some backends return 1 item tuples with strings, and others return
1671 # tuples with integers and strings. Flatten them out into strings.
1672 format_ = self.query.explain_info.format
1673 output_formatter = json.dumps if format_ and format_.lower() == "json" else str
1674 for row in result:
1675 for value in row:
1676 if not isinstance(value, str):
1677 yield " ".join([output_formatter(c) for c in value])
1678 else:
1679 yield value
1680
1681
1682class SQLInsertCompiler(SQLCompiler):

Callers 1

explainMethod · 0.80

Calls 2

execute_sqlMethod · 0.95
joinMethod · 0.45

Tested by

no test coverage detected