Database migrations matter! Get up and running with Alembic + sqlmodel
Ғылым және технология
In this video we will show you how to use Alembic in combination with sqlmodel.
After briefly discussing what a database version control system does, we look at how to get started step by step.
We will run into some (common) errors which I left in because I think you can learn from them.
We also quickly look at what happens when you add a required (or not nullable) column when there is already data the database and I compare it to my experience with Django's migration system.
We hope this makes it easier to start using Alembic together with sqlmodel.
Auto Generating Migrations docs: alembic.sqlalchemy.org/en/lat...
Mentioned video: if _name_ == "__main__": explained: • if __name__ == "__main...
---
We appreciate any feedback 💡 - please use this form so we can always make our content better:
form.jotform.com/230941798741062 🙏
Пікірлер: 16
Great video, thanks! Beside the basic FastAPI / SQLModel setup (which, to be fair, are already greatly covered in the FastAPI docs) there is very little deeper content. For example: what's a good (file)structure for a big FastAPI app including SQLModel and Alembic. Or: how to deal with bigger models and especially m:n relations, there the FastAPI docs are thinning out. Maybe these are ideas for you.
@Pybites
Жыл бұрын
Indeed, those are 2 good topics. I will add them to the list. Thanks, Bob
good stuff! Was looking at this specific combo late last week.
@Pybites
Жыл бұрын
cool, glad we did this video then :) - any other ones we can produce?
great vid, thanks for explaining both libraries so clearly.
@Pybites
8 ай бұрын
Nice, thanks for your kind feedback
@Pybites
8 ай бұрын
Are you using Alembic in your work?
really thanks for this video! it has been essential for me, very clear and pragmatic!
@Pybites
10 ай бұрын
Happy to hear that! Thanks, Bob
@Pybites
10 ай бұрын
And other videos that would be helpful?
@tidytrading9693
10 ай бұрын
@@Pybites for me it would be on using sqlmodel with pandas for managing timeseries data. Thanks again
@Pybites
10 ай бұрын
@@tidytrading9693 these are different tools / requests? So one is using pandas for timeseries (could be one video, but anything more specific), then sqlmodel comes in how to effectively store the data in a DB? Please clarify. Thanks.
Great video Man♥️
@Pybites
10 ай бұрын
Thanks!
Just to make sure i get the "DRY" thing, following this... I conclude that the best practice will be to import my "SQLModel" from my "app" throughout all my files app that require it?
@Pybites
Ай бұрын
would have to look back at the video, do you have a code repo you can share to advice?