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

  • @user-ux2hn2in7j
    @user-ux2hn2in7j Жыл бұрын

    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

    @Pybites

    Жыл бұрын

    Indeed, those are 2 good topics. I will add them to the list. Thanks, Bob

  • @JasonRahm
    @JasonRahm Жыл бұрын

    good stuff! Was looking at this specific combo late last week.

  • @Pybites

    @Pybites

    Жыл бұрын

    cool, glad we did this video then :) - any other ones we can produce?

  • @juvewan
    @juvewan8 ай бұрын

    great vid, thanks for explaining both libraries so clearly.

  • @Pybites

    @Pybites

    8 ай бұрын

    Nice, thanks for your kind feedback

  • @Pybites

    @Pybites

    8 ай бұрын

    Are you using Alembic in your work?

  • @tidytrading9693
    @tidytrading969310 ай бұрын

    really thanks for this video! it has been essential for me, very clear and pragmatic!

  • @Pybites

    @Pybites

    10 ай бұрын

    Happy to hear that! Thanks, Bob

  • @Pybites

    @Pybites

    10 ай бұрын

    And other videos that would be helpful?

  • @tidytrading9693

    @tidytrading9693

    10 ай бұрын

    @@Pybites for me it would be on using sqlmodel with pandas for managing timeseries data. Thanks again

  • @Pybites

    @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.

  • @lovelytyagi1041
    @lovelytyagi104110 ай бұрын

    Great video Man♥️

  • @Pybites

    @Pybites

    10 ай бұрын

    Thanks!

  • @wa.6006
    @wa.6006Ай бұрын

    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

    @Pybites

    Ай бұрын

    would have to look back at the video, do you have a code repo you can share to advice?

Келесі