MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _final_statement

Method _final_statement

lib/sqlalchemy/orm/query.py:554–572  ·  view source on GitHub ↗

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
    )

Source from the content-addressed store, hash-verified

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

Calls 2

_cloneMethod · 0.95
_compile_stateMethod · 0.80