| 47 | await self.aalter_db_add_column(column) |
| 48 | |
| 49 | async def aalter_db_add_column(self, new_column: str): |
| 50 | try: |
| 51 | async with aiosqlite.connect(self.db_path) as db: |
| 52 | await db.execute(f'ALTER TABLE crawled_data ADD COLUMN {new_column} TEXT DEFAULT ""') |
| 53 | await db.commit() |
| 54 | print(f"Added column '{new_column}' to the database.") |
| 55 | except Exception as e: |
| 56 | print(f"Error altering database to add {new_column} column: {e}") |
| 57 | |
| 58 | async def aget_cached_url(self, url: str) -> Optional[Tuple[str, str, str, str, str, str, str, bool, str]]: |
| 59 | try: |