MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _can_drop_table

Method _can_drop_table

lib/sqlalchemy/sql/ddl.py:1617–1628  ·  view source on GitHub ↗
(self, table)

Source from the content-addressed store, hash-verified

1615 self.traverse_single(seq, drop_ok=seq.column is None)
1616
1617 def _can_drop_table(self, table):
1618 self.dialect.validate_identifier(table.name)
1619 effective_schema = self.connection.schema_for_object(table)
1620 if effective_schema:
1621 self.dialect.validate_identifier(effective_schema)
1622 bool_to_check = (
1623 CheckFirst.TABLES if not table.is_view else CheckFirst.VIEWS
1624 )
1625
1626 return not self.checkfirst & bool_to_check or self.dialect.has_table(
1627 self.connection, table.name, schema=effective_schema
1628 )
1629
1630 def _can_drop_index(self, index):
1631 effective_schema = self.connection.schema_for_object(index.table)

Callers 2

visit_metadataMethod · 0.95
visit_tableMethod · 0.95

Calls 3

validate_identifierMethod · 0.45
schema_for_objectMethod · 0.45
has_tableMethod · 0.45

Tested by

no test coverage detected