MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / _table_exists

Method _table_exists

src/core/database.py:54–61  ·  view source on GitHub ↗

Check if a table exists in the database

(self, db, table_name: str)

Source from the content-addressed store, hash-verified

52 yield db
53
54 async def _table_exists(self, db, table_name: str) -> bool:
55 """Check if a table exists in the database"""
56 cursor = await db.execute(
57 "SELECT name FROM sqlite_master WHERE type='table' AND name=?",
58 (table_name,)
59 )
60 result = await cursor.fetchone()
61 return result is not None
62
63 async def _column_exists(self, db, table_name: str, column_name: str) -> bool:
64 """Check if a column exists in a table"""

Callers 1

check_and_migrate_dbMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected