fastapi-sqlmodel-alembic
fastapi-sqlmodel-alembic copied to clipboard
Sample FastAPI project that uses async SQLAlchemy, SQLModel, Postgres, Alembic, and Docker.
Tests
Thanks Mike, appreciate the help this repo provided. One question though: Where are the tests? Isn't this test-driven.io 😂 I read another article you posted (https://testdriven.io/blog/fastapi-crud/) and noticed you use...
First, thanks for this great tutorial. With this async approach, how is it possible to get filtered data from the database (using sqlalchemy and sqlmodel)? [SQLModel's documentations](https://sqlmodel.tiangolo.com/tutorial/where/) suggest using `where`,...
I noticed that in the [article](https://testdriven.io/blog/fastapi-sqlmodel/) init_db was being called in [main.py ](https://github.com/testdrivenio/fastapi-sqlmodel-alembic/blob/main/project/app/main.py)but in the current version that's not happening. I combed through all the files figuring out if i...
I don't know how to repair this but I didn't find any way to do "alembic upgrade head" in docker-compose. But the fact that it's useless is really disgusting. Usually...
Love SQLModel! Got confused in the start because I Pulled HEAD instead of base for the tutorial start.
Thanks for this fast API setup. In this Pull request, I have added some suggestions on issues 1. nullable=False on id to avoid problems on migrations 2. settings file 3....
https://github.com/testdrivenio/fastapi-sqlmodel-alembic/blob/9cdcad44069771b768c0d3892393f57a97b75003/project/app/db.py#L11 Either we use SQLAlchemy. Or we use completely SQLModel. Sqlmodel is built on top SQLAlchemy and Pydantic
firstly: thanks so much for this - it allowed me to get started with relational databases in fastapi really quickly. Thanks!! I noticed a couple of things: - it looks...
I followed this [post](https://testdriven.io/blog/fastapi-sqlmodel/) , everything is fine until I add "year" item in "SongBase", and when I execute `python -m alembic revision --autogenerate -m "add year in SongBase"` the...
I wonder if @app.get("/songs", response_model=list[Song]) async def get_songs(session: AsyncSession = Depends(get_session)): result = await session.execute(select(Song)) return result.scalars().all() wouldn't be the same but shorter then @app.get("/songs", response_model=list[Song]) async def get_songs(session: AsyncSession...