@@ -108,6 +108,7 @@ class EngineAdapter:
108108 SUPPORTS_CLONING = False
109109 SUPPORTS_MANAGED_MODELS = False
110110 SUPPORTS_CREATE_DROP_CATALOG = False
111+ SUPPORTED_DROP_CASCADE_OBJECT_KINDS : t .List [str ] = []
111112 SCHEMA_DIFFER = SchemaDiffer ()
112113 SUPPORTS_TUPLE_IN = True
113114 HAS_VIEW_BINDING = False
@@ -1044,14 +1045,14 @@ def drop_data_object(self, data_object: DataObject, ignore_if_not_exists: bool =
10441045 f"Can't drop data object '{ data_object .to_table ().sql (dialect = self .dialect )} ' of type '{ data_object .type .value } '"
10451046 )
10461047
1047- def drop_table (self , table_name : TableName , exists : bool = True ) -> None :
1048+ def drop_table (self , table_name : TableName , exists : bool = True , ** kwargs : t . Any ) -> None :
10481049 """Drops a table.
10491050
10501051 Args:
10511052 table_name: The name of the table to drop.
10521053 exists: If exists, defaults to True.
10531054 """
1054- self ._drop_object (name = table_name , exists = exists )
1055+ self ._drop_object (name = table_name , exists = exists , ** kwargs )
10551056
10561057 def drop_managed_table (self , table_name : TableName , exists : bool = True ) -> None :
10571058 """Drops a managed table.
@@ -1067,6 +1068,7 @@ def _drop_object(
10671068 name : TableName | SchemaName ,
10681069 exists : bool = True ,
10691070 kind : str = "TABLE" ,
1071+ cascade : bool = False ,
10701072 ** drop_args : t .Any ,
10711073 ) -> None :
10721074 """Drops an object.
@@ -1077,8 +1079,13 @@ def _drop_object(
10771079 name: The name of the table to drop.
10781080 exists: If exists, defaults to True.
10791081 kind: What kind of object to drop. Defaults to TABLE
1082+ cascade: Whether or not to DROP ... CASCADE.
1083+ Note that this is ignored for :kind's that are not present in self.SUPPORTED_DROP_CASCADE_OBJECT_KINDS
10801084 **drop_args: Any extra arguments to set on the Drop expression
10811085 """
1086+ if cascade and kind .upper () in self .SUPPORTED_DROP_CASCADE_OBJECT_KINDS :
1087+ drop_args ["cascade" ] = cascade
1088+
10821089 self .execute (exp .Drop (this = exp .to_table (name ), kind = kind , exists = exists , ** drop_args ))
10831090
10841091 def get_alter_operations (
0 commit comments