summaryrefslogtreecommitdiff
path: root/django/db/models/sql/compiler.py
diff options
context:
space:
mode:
authorAdam Johnson <me@adamj.eu>2021-09-14 18:08:19 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-09-17 07:15:12 +0200
commitfc91ea1e50e5ef207f0f291b3f6c1942b10db7c7 (patch)
treeca675d46dcd256ad638d30e48763361e6eb2dd3d /django/db/models/sql/compiler.py
parent2931d847c246b6f499993e370f6d9a53a83120d2 (diff)
Refs #27624 -- Changed Query.explain_info to namedtuple.
Diffstat (limited to 'django/db/models/sql/compiler.py')
-rw-r--r--django/db/models/sql/compiler.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
index 6b2ea0e017..97288c83d7 100644
--- a/django/db/models/sql/compiler.py
+++ b/django/db/models/sql/compiler.py
@@ -631,10 +631,10 @@ class SQLCompiler:
result.append('HAVING %s' % having)
params.extend(h_params)
- if self.query.explain_query:
+ if self.query.explain_info:
result.insert(0, self.connection.ops.explain_query_prefix(
- self.query.explain_format,
- **self.query.explain_options
+ self.query.explain_info.format,
+ **self.query.explain_info.options
))
if order_by:
@@ -1247,7 +1247,7 @@ class SQLCompiler:
result = list(self.execute_sql())
# Some backends return 1 item tuples with strings, and others return
# tuples with integers and strings. Flatten them out into strings.
- output_formatter = json.dumps if self.query.explain_format == 'json' else str
+ output_formatter = json.dumps if self.query.explain_info.format == 'json' else str
for row in result[0]:
if not isinstance(row, str):
yield ' '.join(output_formatter(c) for c in row)