Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Sensibilisation à
l'Intelligence Artificielle
Voir le programme détaillé
Classe « Query »

Méthode sqlalchemy.orm.Query.execution_options

Signature de la méthode execution_options

def execution_options(self, **kwargs: 'Any') -> 'Self' 

Description

help(Query.execution_options)

Set non-SQL options which take effect during execution.

Options allowed here include all of those accepted by
:meth:`_engine.Connection.execution_options`, as well as a series
of ORM specific options:

``populate_existing=True`` - equivalent to using
:meth:`_orm.Query.populate_existing`

``autoflush=True|False`` - equivalent to using
:meth:`_orm.Query.autoflush`

``yield_per=<value>`` - equivalent to using
:meth:`_orm.Query.yield_per`

Note that the ``stream_results`` execution option is enabled
automatically if the :meth:`~sqlalchemy.orm.query.Query.yield_per()`
method or execution option is used.

.. versionadded:: 1.4 - added ORM options to
   :meth:`_orm.Query.execution_options`

The execution options may also be specified on a per execution basis
when using :term:`2.0 style` queries via the
:paramref:`_orm.Session.execution_options` parameter.

.. warning:: The
   :paramref:`_engine.Connection.execution_options.stream_results`
   parameter should not be used at the level of individual ORM
   statement executions, as the :class:`_orm.Session` will not track
   objects from different schema translate maps within a single
   session.  For multiple schema translate maps within the scope of a
   single :class:`_orm.Session`, see :ref:`examples_sharding`.


.. seealso::

    :ref:`engine_stream_results`

    :meth:`_query.Query.get_execution_options`

    :meth:`_sql.Select.execution_options` - v2 equivalent method.



Vous êtes un professionnel et vous avez besoin d'une formation ? Calcul scientifique
avec Python
Voir le programme détaillé