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 ? Programmation Python
Les compléments
Voir le programme détaillé
Classe « scoped_session »

Méthode sqlalchemy.orm.scoped_session.connection

Signature de la méthode connection

def connection(self, bind_arguments: 'Optional[_BindArguments]' = None, execution_options: 'Optional[CoreExecuteOptionsParameter]' = None) -> 'Connection' 

Description

help(scoped_session.connection)

Return a :class:`_engine.Connection` object corresponding to this
:class:`.Session` object's transactional state.

.. container:: class_bases

    Proxied for the :class:`_orm.Session` class on
    behalf of the :class:`_orm.scoping.scoped_session` class.

Either the :class:`_engine.Connection` corresponding to the current
transaction is returned, or if no transaction is in progress, a new
one is begun and the :class:`_engine.Connection`
returned (note that no
transactional state is established with the DBAPI until the first
SQL statement is emitted).

Ambiguity in multi-bind or unbound :class:`.Session` objects can be
resolved through any of the optional keyword arguments.   This
ultimately makes usage of the :meth:`.get_bind` method for resolution.

:param bind_arguments: dictionary of bind arguments.  May include
 "mapper", "bind", "clause", other custom arguments that are passed
 to :meth:`.Session.get_bind`.

:param execution_options: a dictionary of execution options that will
 be passed to :meth:`_engine.Connection.execution_options`, **when the
 connection is first procured only**.   If the connection is already
 present within the :class:`.Session`, a warning is emitted and
 the arguments are ignored.

 .. seealso::

    :ref:`session_transaction_isolation`




Vous êtes un professionnel et vous avez besoin d'une formation ? Coder avec une
Intelligence Artificielle
Voir le programme détaillé