Spaces:
Runtime error
Runtime error
Commit ·
ba71e80
1
Parent(s): 3dcada4
editDB1
Browse files- models/database.py +3 -0
- requirements.txt +2 -1
models/database.py
CHANGED
|
@@ -10,6 +10,9 @@ import os
|
|
| 10 |
#DB_URL = os.getenv("DATABASE_URL", "sqlite+aiosqlite:///./app.db")
|
| 11 |
DB_URL= get_settings().DATABASE_URL
|
| 12 |
|
|
|
|
|
|
|
|
|
|
| 13 |
engine = create_async_engine(DB_URL, echo=True, future=True)
|
| 14 |
AsyncSessionLocal = sessionmaker(
|
| 15 |
bind=engine, class_=AsyncSession, expire_on_commit=False
|
|
|
|
| 10 |
#DB_URL = os.getenv("DATABASE_URL", "sqlite+aiosqlite:///./app.db")
|
| 11 |
DB_URL= get_settings().DATABASE_URL
|
| 12 |
|
| 13 |
+
if DB_URL.startswith("postgresql://"):
|
| 14 |
+
DB_URL = DB_URL.replace("postgresql://", "postgresql+asyncpg://", 1)
|
| 15 |
+
|
| 16 |
engine = create_async_engine(DB_URL, echo=True, future=True)
|
| 17 |
AsyncSessionLocal = sessionmaker(
|
| 18 |
bind=engine, class_=AsyncSession, expire_on_commit=False
|
requirements.txt
CHANGED
|
@@ -12,4 +12,5 @@ groq==1.0.0
|
|
| 12 |
aiohttp==3.13.3
|
| 13 |
assemblyai==0.58.0
|
| 14 |
deepgram-sdk==6.0.1
|
| 15 |
-
asyncpg==0.31.0
|
|
|
|
|
|
| 12 |
aiohttp==3.13.3
|
| 13 |
assemblyai==0.58.0
|
| 14 |
deepgram-sdk==6.0.1
|
| 15 |
+
asyncpg==0.31.0
|
| 16 |
+
psycopg2-binary==2.9.9
|