Returns the SQL query that will be executed. By default, it will return the query with placeholders, but if you set `params_inline=True`, it will inline the parameters. :param params_inline: Whether to inline the parameters
(self, params_inline=False)
| 296 | return any(info.term.is_aggregate for info in annotation_info.values()) |
| 297 | |
| 298 | def sql(self, params_inline=False) -> str: |
| 299 | """ |
| 300 | Returns the SQL query that will be executed. By default, it will return the query with |
| 301 | placeholders, but if you set `params_inline=True`, it will inline the parameters. |
| 302 | |
| 303 | :param params_inline: Whether to inline the parameters |
| 304 | """ |
| 305 | self._choose_db_if_not_chosen() |
| 306 | |
| 307 | self._make_query() |
| 308 | if params_inline: |
| 309 | sql = self.query.get_sql() |
| 310 | else: |
| 311 | sql, _ = self.query.get_parameterized_sql() |
| 312 | return sql |
| 313 | |
| 314 | def _make_query(self) -> None: |
| 315 | raise NotImplementedError() # pragma: nocoverage |