Check if a column exists in a table
(self, db, table_name: str, column_name: str)
| 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""" |
| 65 | try: |
| 66 | cursor = await db.execute(f"PRAGMA table_info({table_name})") |
| 67 | columns = await cursor.fetchall() |
| 68 | return any(col[1] == column_name for col in columns) |
| 69 | except: |
| 70 | return False |
| 71 | |
| 72 | async def _ensure_config_rows(self, db, config_dict: dict = None): |
| 73 | """Ensure all config tables have their default rows |
no outgoing calls
no test coverage detected