MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / set_dropper_ddl

Method set_dropper_ddl

lib/sqlalchemy/sql/schema.py:1049–1069  ·  view source on GitHub ↗

Set the table drop DDL for this :class:`.Table`. This allows the DROP TABLE statement to be controlled or replaced entirely when :meth:`.Table.drop` or :meth:`.MetaData.drop_all` is used. E.g.:: from sqlalchemy.schema import DropTable table

(self, ddl: TableDropDDL)

Source from the content-addressed store, hash-verified

1047 self._creator_ddl = ddl
1048
1049 def set_dropper_ddl(self, ddl: TableDropDDL) -> None:
1050 """Set the table drop DDL for this :class:`.Table`.
1051
1052 This allows the DROP TABLE statement to be controlled or replaced
1053 entirely when :meth:`.Table.drop` or :meth:`.MetaData.drop_all` is
1054 used.
1055
1056 E.g.::
1057
1058 from sqlalchemy.schema import DropTable
1059
1060 table.set_dropper_ddl(DropTable(table, if_exists=True))
1061
1062 .. versionadded:: 2.1
1063
1064 .. seealso::
1065
1066 :meth:`.Table.set_creator_ddl`
1067
1068 """
1069 self._dropper_ddl = ddl
1070
1071 @property
1072 def is_view(self) -> bool:

Calls

no outgoing calls