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 « scoped_session »

Méthode sqlalchemy.orm.scoped_session.flush

Signature de la méthode flush

def flush(self, objects: 'Optional[Sequence[Any]]' = None) -> 'None' 

Description

help(scoped_session.flush)

Flush all the object changes to the database.

.. container:: class_bases

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

Writes out all pending object creations, deletions and modifications
to the database as INSERTs, DELETEs, UPDATEs, etc.  Operations are
automatically ordered by the Session's unit of work dependency
solver.

Database operations will be issued in the current transactional
context and do not affect the state of the transaction, unless an
error occurs, in which case the entire transaction is rolled back.
You may flush() as often as you like within a transaction to move
changes from Python to the database's transaction buffer.

:param objects: Optional; restricts the flush operation to operate
  only on elements that are in the given collection.

  This feature is for an extremely narrow set of use cases where
  particular objects may need to be operated upon before the
  full flush() occurs.  It is not intended for general use.




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