Return the 'final' SELECT statement for this :class:`.Query`. This is used by the testing suite only and is fairly inefficient. This is the Core-only select() that will be rendered by a complete compilation of this query, and is what .statement used to return in 1.3
(
self, legacy_query_style: bool = True
)
| 552 | return stmt |
| 553 | |
| 554 | def _final_statement( |
| 555 | self, legacy_query_style: bool = True |
| 556 | ) -> Select[Unpack[TupleAny]]: |
| 557 | """Return the 'final' SELECT statement for this :class:`.Query`. |
| 558 | |
| 559 | This is used by the testing suite only and is fairly inefficient. |
| 560 | |
| 561 | This is the Core-only select() that will be rendered by a complete |
| 562 | compilation of this query, and is what .statement used to return |
| 563 | in 1.3. |
| 564 | |
| 565 | |
| 566 | """ |
| 567 | |
| 568 | q = self._clone() |
| 569 | |
| 570 | return q._compile_state( |
| 571 | use_legacy_query_style=legacy_query_style |
| 572 | ).statement # type: ignore |
| 573 | |
| 574 | def _statement_20( |
| 575 | self, for_statement: bool = False, use_legacy_query_style: bool = True |