Christophe Bourgoin Claude commited on
Commit
74021a7
·
1 Parent(s): f90fc86

Fix: Add aiosqlite for async database support

Browse files

The Google ADK's DatabaseSessionService requires an async SQLite
driver. This adds aiosqlite and updates the database URL to use it.

Changes:
- Added aiosqlite>=0.19.0 to requirements.txt and pyproject.toml
- Changed db_url from sqlite:/// to sqlite+aiosqlite:///
- Fixes SQLAlchemy error: "asyncio extension requires async driver"

This resolves the error:
"The loaded 'pysqlite' is not async"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Files changed (3) hide show
  1. main.py +2 -1
  2. pyproject.toml +1 -0
  3. requirements.txt +3 -0
main.py CHANGED
@@ -70,7 +70,8 @@ async def run_content_generation(topic: str, preferences: dict = None, session_i
70
  # Initialize persistent session service
71
  # Note: PROFILE_DIR is created at module import in src/profile.py
72
  db_path = PROFILE_DIR / "sessions.db"
73
- db_url = f"sqlite:///{db_path}"
 
74
  session_service = DatabaseSessionService(db_url=db_url)
75
 
76
  # Create runner
 
70
  # Initialize persistent session service
71
  # Note: PROFILE_DIR is created at module import in src/profile.py
72
  db_path = PROFILE_DIR / "sessions.db"
73
+ # Use aiosqlite driver for async SQLite (required by ADK)
74
+ db_url = f"sqlite+aiosqlite:///{db_path}"
75
  session_service = DatabaseSessionService(db_url=db_url)
76
 
77
  # Create runner
pyproject.toml CHANGED
@@ -37,6 +37,7 @@ dependencies = [
37
  "duckduckgo-search>=6.0.0",
38
  "pyyaml>=6.0",
39
  "pandas>=2.0.0",
 
40
  ]
41
 
42
  [project.optional-dependencies]
 
37
  "duckduckgo-search>=6.0.0",
38
  "pyyaml>=6.0",
39
  "pandas>=2.0.0",
40
+ "aiosqlite>=0.19.0",
41
  ]
42
 
43
  [project.optional-dependencies]
requirements.txt CHANGED
@@ -7,3 +7,6 @@ python-dotenv>=1.0.0
7
  requests>=2.31.0
8
  duckduckgo-search>=6.0.0
9
  google-cloud-aiplatform>=1.38.0
 
 
 
 
7
  requests>=2.31.0
8
  duckduckgo-search>=6.0.0
9
  google-cloud-aiplatform>=1.38.0
10
+
11
+ # Async SQLite driver (required for DatabaseSessionService)
12
+ aiosqlite>=0.19.0