Setting up Alembic with SQLAlchemy

preview_player
Показать описание
In this video, Jose Haro Peralta explains how to set up Alembic to manage migrations with SQLAlchemy. You'll also learn to add to or query data from the database using SQLAlchemy.

Chapters:
0:00 Introduction
2:54 Setting up the environment for the tutorial and installing dependencies
4:30 Initialising Alembic
5:13 Configuring Alembic
6:52 Creating a SQLAlchemy model
10:02 Creating a migration with Alembic
10:52 Running a migration with Alembic
11:15 Writing to the database using SQLAlchemy models
14:20 Reading from the database using SQLAlchemy models
14:54 Enriching SQLAlchemy models with additional propetries and methods
17:53 Wrapping up

What are SQLAlchemy and Alembic?

If you liked this video, please like it and share it with your network! You can also subscribe to my channel! All this goes a long way to supporting me to continue creating this kind of content.

ERRATA:
* In the section 7:20-7:40 I wrongly say that declarative_base() is an Alembic function. declarative_base() is a SQLALchemy function and the Base class is a SQLAlchemy class.
Рекомендации по теме
Комментарии
Автор

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

kingsleyakpan
Автор

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

Sparshchokra
Автор

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

nivshitrit
Автор

best tutorial for sqlalchemy + alembic

rashmimanandhar
Автор

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.

petermoore
Автор

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.

robertoferro
Автор

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

rafaelfurquim
Автор

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

moiattube
Автор

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

Daniel-tojd
Автор

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!

ilias
Автор

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

davidcarter
Автор

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

danielmurrell
Автор

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

naveenkumar-noxj
Автор

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

kingstonxavier
Автор

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?

dughall_
Автор

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! :)

doremicocoparis
Автор

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?

parker
visit shbcf.ru