feat: add support for asyncpg

This commit is contained in:
2025-07-24 21:23:09 +00:00
parent 929ed9db9b
commit 26dd45ae95
2 changed files with 14 additions and 8 deletions

View File

@@ -19,8 +19,9 @@ app.add_middleware(
async def startup():
await database.connect()
# create tables if they don't exist
Base.metadata.create_all(bind=engine)
# create tables if they don't exist TODO: maybe?
async with engine.begin() as conn:
await conn.run_sync(Base.metadata.create_all)
@app.on_event("shutdown")
async def shutdown():