MCPcopy
hub / github.com/unclecode/crawl4ai / alter_db_add_screenshot

Function alter_db_add_screenshot

crawl4ai/database.py:31–40  ·  view source on GitHub ↗
(new_column: str = "media")

Source from the content-addressed store, hash-verified

29 conn.close()
30
31def alter_db_add_screenshot(new_column: str = "media"):
32 check_db_path()
33 try:
34 conn = sqlite3.connect(DB_PATH)
35 cursor = conn.cursor()
36 cursor.execute(f'ALTER TABLE crawled_data ADD COLUMN {new_column} TEXT DEFAULT ""')
37 conn.commit()
38 conn.close()
39 except Exception as e:
40 print(f"Error altering database to add screenshot column: {e}")
41
42def check_db_path():
43 if not DB_PATH:

Callers

nothing calls this directly

Calls 2

check_db_pathFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…