MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / has_table

Method has_table

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

Source from the content-addressed store, hash-verified

2322
2323 @reflection.cache
2324 def has_table(self, connection, table_name, schema=None, **kw):
2325 self._ensure_has_table_connection(connection)
2326
2327 if schema is not None and schema not in self.get_schema_names(
2328 connection, **kw
2329 ):
2330 return False
2331
2332 info = self._get_table_pragma(
2333 connection, "table_info", table_name, schema=schema
2334 )
2335 return bool(info)
2336
2337 def _get_default_schema_name(self, connection):
2338 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