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

Function init_db

crawl4ai/database.py:10–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8DB_PATH = os.path.join(DB_PATH, "crawl4ai.db")
9
10def init_db():
11 global DB_PATH
12 conn = sqlite3.connect(DB_PATH)
13 cursor = conn.cursor()
14 cursor.execute('''
15 CREATE TABLE IF NOT EXISTS crawled_data (
16 url TEXT PRIMARY KEY,
17 html TEXT,
18 cleaned_html TEXT,
19 markdown TEXT,
20 extracted_content TEXT,
21 success BOOLEAN,
22 media TEXT DEFAULT "{}",
23 links TEXT DEFAULT "{}",
24 metadata TEXT DEFAULT "{}",
25 screenshot TEXT DEFAULT ""
26 )
27 ''')
28 conn.commit()
29 conn.close()
30
31def alter_db_add_screenshot(new_column: str = "media"):
32 check_db_path()

Callers 3

database.pyFile · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…