Setting up Alembic with SQLAlchemy

Поділитися
Вставка
  • Опубліковано 9 лис 2024

КОМЕНТАРІ • 54

  • @kingsleyakpan3828
    @kingsleyakpan3828 8 місяців тому +2

    You don't come across resources like this very often. Thank you!!!

    • @microapis
      @microapis  5 місяців тому

      Thank you for your supportive comment @kingsleyakpan3828!

  • @petermoore8811
    @petermoore8811 Рік тому +1

    Very useful. Thanks for the guide! Its essential to get off on the right path with these complex setups. There is so much to stitch together these days that these tutorials are invaluable. Good job.

    • @microapis
      @microapis  Рік тому

      Thank you for your kind words 🚀! You're absolutely right 💯. I've seen a ton of bad practices around, which was the motivation to make these videos!

    • @petermoore8811
      @petermoore8811 Рік тому

      @microapis I've been using alembic a while now, and it's great. But I think they should have numbered the migration files so it sorts in the file system. It might be an easy thing to add. Might do a PR with that function added

  • @Sparshchokra
    @Sparshchokra 2 роки тому +1

    Best Video out of All Alembic explanation because you have introduced SQLAlchemy rather doing Alembic way of creation of tables. Thanks a lot

    • @microapis
      @microapis  2 роки тому

      Hi Vashu thank you so much for your kind feedback 😍!

  • @nivshitrit248
    @nivshitrit248 2 роки тому +9

    That is the best tutorial on youtube for sqlalchemy + alembic, thank you!

    • @microapis
      @microapis  2 роки тому

      Thank you so much for the nice feedback!!

  • @rashmimanandhar7828
    @rashmimanandhar7828 2 роки тому +2

    best tutorial for sqlalchemy + alembic

    • @microapis
      @microapis  2 роки тому

      Thank you so much for your kind feedback @Rashmi!

  • @robertoferro8512
    @robertoferro8512 2 роки тому +5

    Short, sharp and to the point. Thank you! Please keep making videos like this. I'd also encourage you to make a Udemy course version of your book. Keep up the great work.

    • @microapis
      @microapis  2 роки тому +2

      Hi Roberto thank you for your kind feedback! I'm planning a Udemy course actually 😁, hopefully will release early next year!

  • @moiattube
    @moiattube 14 днів тому

    Very clear explanation.
    I just miss the explanation of a change in the data model, so you had shown the power of alembic.
    Anyway, thank you a lot for this introduction

  • @wilsonmuita6835
    @wilsonmuita6835 Рік тому +1

    Very informative.
    Much gratitude.

    • @microapis
      @microapis  Рік тому

      Thank you for your kind feedback 🙌!

  • @rafaelfurquim745
    @rafaelfurquim745 5 місяців тому +1

    Thank you very much, you help me a lot! Congrats for this video.

    • @microapis
      @microapis  5 місяців тому

      Thank you for your kind comment @rafaelfurquim745 🙌!

  • @lucasalvarezlacasa2098
    @lucasalvarezlacasa2098 Рік тому +1

    Thank you so much for this video. Super clear on how to use Alembic in combination with SQLAlchemy :)

    • @microapis
      @microapis  Рік тому

      Thank you for your kind feedback Lucas 🚀!

  • @Daniel-to5jd
    @Daniel-to5jd 2 роки тому +1

    This video helped me to understand Alembic documentation, thank you man!

    • @microapis
      @microapis  2 роки тому +1

      Hi Daniel thank you so much for your kind feedback! I'm really glad to hear the video helped you with with the Alembic docs!

  • @ilias4780
    @ilias4780 2 роки тому +1

    Thank you very much man, great video. I would love if you had added some extra bits of information other than the introductory stuff but maybe in another video? Thanks again!

    • @microapis
      @microapis  2 роки тому

      Thank you so much for your feedback! That's right, I'm planning another video with more advanced material about SQLAlchemy. I hope to be able to release it soon!

  • @conorscully7182
    @conorscully7182 2 роки тому +2

    great intro to alembic, thanks

    • @microapis
      @microapis  2 роки тому

      Thank you for your kind feedback @Conor!

  • @naveenkumar-no5xj
    @naveenkumar-no5xj 2 роки тому +1

    Nice video, in this video you created table....can you show the extension by adding a new column in already created table and show how upgrade and down grade can be done. Also please show how to support multi db

    • @microapis
      @microapis  2 роки тому

      Hi Naveen thank you for your nice feedback and for your suggestions! I'm preparing work for a new video and I'll make sure I cover those topics.

  • @davidcarter4454
    @davidcarter4454 11 місяців тому +1

    Great video, thank you. You can do f"{variable_name=}" to print variable_name=value

    • @microapis
      @microapis  9 місяців тому

      Thanks for the tip @davidcarter4454 I didn't know that one 👏!

  • @kingstonxavier
    @kingstonxavier Рік тому +1

    Thanks a lot! can you please make a video on creating replaceable objects such as views, materialized views, SPs etc.?

    • @microapis
      @microapis  Рік тому

      Hi Dr Kingston thanks for the suggestion, that's an awesome idea! It's really not very difficult and these are great performance boosters. I used views extensively in a recent project to speed up queries for a machine learning engine. I'll put this on the list of upcoming videos 🚀!

  • @Dobleboyler
    @Dobleboyler Рік тому +1

    Thanks bro, that was amazing,

    • @microapis
      @microapis  Рік тому

      Hi Doble thank you for your kind feedback 🙌🙏!

  • @jiwonchoi2470
    @jiwonchoi2470 2 роки тому +4

    Great tutorial, thanks! 👍

    • @microapis
      @microapis  2 роки тому

      Thank you for your feedback!

  • @emma_promise_smartnbc4331
    @emma_promise_smartnbc4331 8 місяців тому +1

    Thank you so much

  • @reynaldocartana7171
    @reynaldocartana7171 2 роки тому +1

    Great Video!

    • @microapis
      @microapis  2 роки тому

      Thank you for your kind feedback!

  • @lucasaranhalopes8343
    @lucasaranhalopes8343 Рік тому +1

    Very good!!

    • @microapis
      @microapis  Рік тому

      Thank you for your kind words ❤!

  • @luchanos
    @luchanos Рік тому +1

    Thanks a lot!

  • @danielmurrell9445
    @danielmurrell9445 2 роки тому +1

    What are you using to import things at 8:13? Is it a VSCode plugin?

    • @microapis
      @microapis  2 роки тому

      Hi Daniel sorry for my late reply! Thank you for your question! I use Pycharm. There's an easy keyboard shortcut for this in Pycharm. Unfortunately, I don't have experience with VSCode so I can't advice, but I believe both IDEs are quite similar so I'm sure there must be a plugin or perhaps built-in support for this

  • @one1axis
    @one1axis 2 роки тому +1

    Thanks!

    • @microapis
      @microapis  2 роки тому

      Thanks for watching and for your kind feedback!

  • @parker02311
    @parker02311 2 роки тому +1

    Hey there, amazing video! I would not have understood Alembic without it, I do have once question though. Would this be good for use in a open source project that anyone can use to help them migrate there database when the project updates or is there a better way?

    • @microapis
      @microapis  2 роки тому

      Thanks for your kind feedback! You think of a library that makes it easier to set up SQLAlchemy with Alembic? I think that could be useful yeah!

  • @doremicocoparis9410
    @doremicocoparis9410 2 роки тому +1

    Hey is it compatibile with sqlalchemy 1.4, I'm too new to see the difference but I'd like to focus on the future! :)

    • @microapis
      @microapis  2 роки тому

      Hi @doremicocoparis thanks for the question! I did the video using SQLAlchemy version 1.4.29 so it should work the same for all versions of 1.4. It'll also work for previous versions such as 1.3.

  • @dughall_
    @dughall_ 2 роки тому +2

    Hello, I've tried your code locally and when trying to autogenerate the alembic migration file I get this error:
    ModuleNotFoundError: No module named 'models'
    Can you please help?

    • @microapis
      @microapis  2 роки тому +1

      Hi thanks for checking out the tutorial and for trying out the code! Can I check first of all that your setup looks exactly like in the video (you can check the GitHub repository as well: github.com/abunuwas/alembic-sqlalchemy-tutorial)? In particular, to make sure your models file is named correctly without a typo. Second, make sure you're running the command from the root directory of the application (where models.py is located) as I do in the video. If you're using an IDE like PyCharm or VS Code to run the code, make sure you set PYTHONPATH to the root directory of the application. Please let me know if this helps. Feel free to provide more details if it still does't work. You can raise an Issue in the GitHub repo if that's easier.

    • @dughall_
      @dughall_ 2 роки тому +2

      @@microapis Hello, thank you for the answer, the issue was fixed eventually, my mistake was installing alembic from apt and not from pip.

    • @microapis
      @microapis  2 роки тому +1

      @@dughall_ Got it glad to hear you were able to fix it!