This repository shows a very simple example on how to create an all async project using FastAPI, SQLAlchemy Core (not ORM), and Alembic.
DB migrations are done automatically upon application start. However, alembic upgrade head
works perfectly too.
git clone [email protected]:ijohn/fastapi-async-sqlalchemy.git
cd fastapi-async-sqlalchemy
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
DATABASE_URL='sqlite+aiosqlite:///./main.db' python main.py
Open up your browser and visit http://localhost:8000/docs
.