LeadPilot / backend /test_db_simple.py
Ashraf Al-Kassem
feat: LeadPilot β€” full project commit (Missions 1–13)
8d7950f
raw
history blame
503 Bytes
import asyncio
from sqlmodel import SQLModel
from sqlalchemy.ext.asyncio import create_async_engine
async def test_db():
try:
engine = create_async_engine("sqlite+aiosqlite:///./leadpilot.db")
async with engine.begin() as conn:
print("Connected to DB")
await conn.run_sync(SQLModel.metadata.create_all)
print("Tables checked/created")
except Exception as e:
print(f"Error: {e}")
if __name__ == "__main__":
asyncio.run(test_db())