MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / options

Method options

lib/sqlalchemy/orm/query.py:1657–1685  ·  view source on GitHub ↗

Return a new :class:`_query.Query` object, applying the given list of mapper options. Most supplied options regard changing how column- and relationship-mapped attributes are loaded. .. seealso:: :ref:`loading_columns` :ref:`relatio

(self, *args: ExecutableOption)

Source from the content-addressed store, hash-verified

1655
1656 @_generative
1657 def options(self, *args: ExecutableOption) -> Self:
1658 """Return a new :class:`_query.Query` object,
1659 applying the given list of
1660 mapper options.
1661
1662 Most supplied options regard changing how column- and
1663 relationship-mapped attributes are loaded.
1664
1665 .. seealso::
1666
1667 :ref:`loading_columns`
1668
1669 :ref:`relationship_loader_options`
1670
1671 """
1672
1673 opts = tuple(util.flatten_iterator(args))
1674 if self._compile_options._current_path:
1675 # opting for lower method overhead for the checks
1676 for opt in opts:
1677 if not opt._is_core and opt._is_legacy_option: # type: ignore
1678 opt.process_query_conditionally(self) # type: ignore
1679 else:
1680 for opt in opts:
1681 if not opt._is_core and opt._is_legacy_option: # type: ignore
1682 opt.process_query(self) # type: ignore
1683
1684 self._with_options += opts
1685 return self
1686
1687 def with_transformation(
1688 self, fn: Callable[[Query[Any]], Query[Any]]

Callers 15

_add_lazyload_optionsMethod · 0.45
_setup_orm_returningMethod · 0.45
_load_on_pk_identityFunction · 0.45
do_loadFunction · 0.45
_get_implMethod · 0.45
_setup_optionsMethod · 0.45
_load_for_pathMethod · 0.45
_list_dbsFunction · 0.45
_engine_uriFunction · 0.45
goMethod · 0.45

Calls 2

process_queryMethod · 0.80