MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / enable_eagerloads

Method enable_eagerloads

lib/sqlalchemy/orm/query.py:894–910  ·  view source on GitHub ↗

Control whether or not eager joins and subqueries are rendered. When set to False, the returned Query will not render eager joins regardless of :func:`~sqlalchemy.orm.joinedload`, :func:`~sqlalchemy.orm.subqueryload` options or mapper-level ``lazy='joined'``/

(self, value: bool)

Source from the content-addressed store, hash-verified

892
893 @_generative
894 def enable_eagerloads(self, value: bool) -> Self:
895 """Control whether or not eager joins and subqueries are
896 rendered.
897
898 When set to False, the returned Query will not render
899 eager joins regardless of :func:`~sqlalchemy.orm.joinedload`,
900 :func:`~sqlalchemy.orm.subqueryload` options
901 or mapper-level ``lazy='joined'``/``lazy='subquery'``
902 configurations.
903
904 This is used primarily when nesting the Query's
905 statement into a subquery or other
906 selectable, or when using :meth:`_query.Query.yield_per`.
907
908 """
909 self._compile_options += {"_enable_eagerloads": value}
910 return self
911
912 @_generative
913 def _with_compile_options(self, **opt: Any) -> Self:

Callers 12

subqueryMethod · 0.95
cteMethod · 0.95
labelMethod · 0.95
scalar_subqueryMethod · 0.95
existsMethod · 0.95
_values_no_warnMethod · 0.80
countMethod · 0.80
__init__Method · 0.80
test_query_oneMethod · 0.80
goMethod · 0.80

Calls

no outgoing calls

Tested by 4

test_query_oneMethod · 0.64
goMethod · 0.64