MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / before_drop

Method before_drop

lib/sqlalchemy/sql/events.py:246–275  ·  view source on GitHub ↗

r"""Called before DROP statements are emitted. :param target: the :class:`.SchemaObject`, such as a :class:`_schema.MetaData` or :class:`_schema.Table` but also including all create/drop objects such as :class:`.Index`, :class:`.Sequence`, etc., object wh

(
        self, target: SchemaEventTarget, connection: Connection, **kw: Any
    )

Source from the content-addressed store, hash-verified

244 """
245
246 def before_drop(
247 self, target: SchemaEventTarget, connection: Connection, **kw: Any
248 ) -> None:
249 r"""Called before DROP statements are emitted.
250
251 :param target: the :class:`.SchemaObject`, such as a
252 :class:`_schema.MetaData` or :class:`_schema.Table`
253 but also including all create/drop objects such as
254 :class:`.Index`, :class:`.Sequence`, etc.,
255 object which is the target of the event.
256
257 .. versionadded:: 2.0 Support for all :class:`.SchemaItem` objects
258 was added.
259
260 :param connection: the :class:`_engine.Connection` where the
261 DROP statement or statements will be emitted.
262 :param \**kw: additional keyword arguments relevant
263 to the event. The contents of this dictionary
264 may vary across releases, and include the
265 list of tables being generated for a metadata-level
266 event, the checkfirst flag, and other
267 elements used by internal events.
268
269 :func:`.event.listen` also accepts the ``propagate=True``
270 modifier for this event; when True, the listener function will
271 be established for any copies made of the target object,
272 i.e. those copies that are generated when
273 :meth:`_schema.Table.to_metadata` is used.
274
275 """
276
277 def after_drop(
278 self, target: SchemaEventTarget, connection: Connection, **kw: Any

Callers 8

with_ddl_eventsMethod · 0.80
test_table_drop_bothMethod · 0.80
test_table_allMethod · 0.80
test_table_integratedMethod · 0.80

Calls

no outgoing calls

Tested by 7

test_table_drop_bothMethod · 0.64
test_table_allMethod · 0.64
test_table_integratedMethod · 0.64