(self)
| 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 | |
| 1682 | class SQLInsertCompiler(SQLCompiler): |
no test coverage detected