Re:SQLModel – SQL Databases in FastAPI
by tiangolo on Wednesday August 25, 2021 @06:34AM
(#28299880)
Yep, less code duplication between Pydantic and SQLAlchemy, autocompletion and inline errors in editors (e.g. when creating new instances and when fetching data from the database), because it has several type annotation tricks.
It's all just SQLAlchemy, so the same migrations with Alembic would do it, I plan on documenting that in the future and probably adding a thin layer on top.
Am I understanding right that the main benefit of using sqlmodel is not needing to maintain the 2 separate models for the app vs db that one would need in most cases?
Also, have you thought about an approach to migrations yet? Curious to hear your thoughts there as well.