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

Function update_existing_records

crawl4ai/database.py:118–127  ·  view source on GitHub ↗
(new_column: str = "media", default_value: str = "{}")

Source from the content-addressed store, hash-verified

116 print(f"Error flushing database: {e}")
117
118def update_existing_records(new_column: str = "media", default_value: str = "{}"):
119 check_db_path()
120 try:
121 conn = sqlite3.connect(DB_PATH)
122 cursor = conn.cursor()
123 cursor.execute(f'UPDATE crawled_data SET {new_column} = "{default_value}" WHERE screenshot IS NULL')
124 conn.commit()
125 conn.close()
126 except Exception as e:
127 print(f"Error updating existing records: {e}")
128
129if __name__ == "__main__":
130 # Delete the existing database file

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…