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

Method ainit_db

crawl4ai/async_database.py:15–32  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

13 self.db_path = DB_PATH
14
15 async def ainit_db(self):
16 async with aiosqlite.connect(self.db_path) as db:
17 await db.execute('''
18 CREATE TABLE IF NOT EXISTS crawled_data (
19 url TEXT PRIMARY KEY,
20 html TEXT,
21 cleaned_html TEXT,
22 markdown TEXT,
23 extracted_content TEXT,
24 success BOOLEAN,
25 media TEXT DEFAULT "{}",
26 links TEXT DEFAULT "{}",
27 metadata TEXT DEFAULT "{}",
28 screenshot TEXT DEFAULT ""
29 )
30 ''')
31 await db.commit()
32 await self.update_db_schema()
33
34 async def update_db_schema(self):
35 async with aiosqlite.connect(self.db_path) as db:

Callers 1

awarmupMethod · 0.80

Calls 1

update_db_schemaMethod · 0.95

Tested by

no test coverage detected