feat: add support for asyncpg
This commit is contained in:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user