MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _can_create_table

Method _can_create_table

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

Source from the content-addressed store, hash-verified

1361 self.memo = {}
1362
1363 def _can_create_table(self, table):
1364 self.dialect.validate_identifier(table.name)
1365 effective_schema = self.connection.schema_for_object(table)
1366 if effective_schema:
1367 self.dialect.validate_identifier(effective_schema)
1368
1369 bool_to_check = (
1370 CheckFirst.TABLES if not table.is_view else CheckFirst.VIEWS
1371 )
1372 return (
1373 not self.checkfirst & bool_to_check
1374 or not self.dialect.has_table(
1375 self.connection, table.name, schema=effective_schema
1376 )
1377 )
1378
1379 def _can_create_index(self, index):
1380 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