tranny / App /__main__.py
Mbonea's picture
testing other
bf10ebf
raw
history blame
593 Bytes
# from App.app import app
from App.modelInit import models, dbLink
import asyncio
from sqlalchemy.ext.asyncio import create_async_engine
async def async_main() -> None:
engine = create_async_engine(
dbLink,
echo=True,
)
async with engine.begin() as conn:
await conn.run_sync(models.metadata.create_all)
import uvicorn
async def create_tables():
await models.create_all()
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(create_tables())
loop.close()
uvicorn.run(app, host="0.0.0.0", port=7860)