MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / has_table

Method has_table

lib/sqlalchemy/dialects/sqlite/base.py:2337–2348  ·  view source on GitHub ↗
(self, connection, table_name, schema=None, **kw)

Source from the content-addressed store, hash-verified

2335
2336 @reflection.cache
2337 def has_table(self, connection, table_name, schema=None, **kw):
2338 self._ensure_has_table_connection(connection)
2339
2340 if schema is not None and schema not in self.get_schema_names(
2341 connection, **kw
2342 ):
2343 return False
2344
2345 info = self._get_table_pragma(
2346 connection, "table_info", table_name, schema=schema
2347 )
2348 return bool(info)
2349
2350 def _get_default_schema_name(self, connection):
2351 return "main"

Callers 2

get_columnsMethod · 0.95
get_indexesMethod · 0.95

Calls 3

get_schema_namesMethod · 0.95
_get_table_pragmaMethod · 0.95

Tested by

no test coverage detected