MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / after_bulk_delete

Method after_bulk_delete

lib/sqlalchemy/orm/events.py:2120–2152  ·  view source on GitHub ↗

Event for after the legacy :meth:`_orm.Query.delete` method has been called. .. legacy:: The :meth:`_orm.SessionEvents.after_bulk_delete` method is a legacy event hook as of SQLAlchemy 2.0. The event **does not participate** in :term:`2.0 style` invocations

(self, delete_context: _O)

Source from the content-addressed store, hash-verified

2118 """
2119
2120 def after_bulk_delete(self, delete_context: _O) -> None:
2121 """Event for after the legacy :meth:`_orm.Query.delete` method
2122 has been called.
2123
2124 .. legacy:: The :meth:`_orm.SessionEvents.after_bulk_delete` method
2125 is a legacy event hook as of SQLAlchemy 2.0. The event
2126 **does not participate** in :term:`2.0 style` invocations
2127 using :func:`_dml.delete` documented at
2128 :ref:`orm_queryguide_update_delete_where`. For 2.0 style use,
2129 the :meth:`_orm.SessionEvents.do_orm_execute` hook will intercept
2130 these calls.
2131
2132 :param delete_context: a "delete context" object which contains
2133 details about the update, including these attributes:
2134
2135 * ``session`` - the :class:`.Session` involved
2136 * ``query`` -the :class:`_query.Query`
2137 object that this update operation
2138 was called upon.
2139 * ``result`` the :class:`_engine.CursorResult`
2140 returned as a result of the
2141 bulk DELETE operation.
2142
2143 .. versionchanged:: 1.4 the update_context no longer has a
2144 ``QueryContext`` object associated with it.
2145
2146 .. seealso::
2147
2148 :meth:`.QueryEvents.before_compile_delete`
2149
2150 :meth:`.SessionEvents.after_bulk_update`
2151
2152 """
2153
2154 @_lifecycle_event
2155 def transient_to_pending(self, session: Session, instance: _O) -> None:

Callers 1

deleteMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected