Two frameworks that have taken the Python world by storm are FastAPI and Pydantic. Once you already have your data exchange modeled in Pydantic, you might want to use that code for storing it in the database. And, if you have DB models you might want to somehow use them to power and document the APIs built with FastAPI.
But the popular ORMs, such as SQLAlchemy and others, far predate Pydantic. But could they be put together?
Sebastián Ramírez is here to tell us the answer is yes. We're covering his project SQLModel which is the marriage between Pydantic and SQLAlchemy.
▬▬▬▬ About the podcast ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
This video is the uncut, live recording of the Talk Python To Me podcast ( https://talkpython.fm ). We cover Python-focused topics every week and publish the edited and polished version in audio form. Subscribe in your podcast player of choice (100% free) at https://talkpython.fm/subscribe.
▬▬▬▬ Guests ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Sebastián Ramírez: https://twitter.com/tiangolo
▬▬▬▬ Links and resources from the show ▬▬▬▬▬▬▬▬▬▬▬▬
SQLModel: https://sqlmodel.tiangolo.com/
Create a SQLModel Model: https://sqlmodel.tiangolo.com/#create-a-sqlmodel-model
Multiple Models: https://sqlmodel.tiangolo.com/tutorial/fastapi/multiple-models/
FastAPI Talk Python episode: https://talkpython.fm/episodes/show/284/modern-and-fast-apis-with-fastapi
FastAPI Dependency Injection: https://fastapi.tiangolo.com/tutorial/dependencies/
ODMantic for MongoDB: https://github.com/art049/odmantic
Beanie for MongoDB: https://github.com/roman-right/beanie
Michael's Short video on Pydantic:
https://www.youtube.com/watch?v=aHv7-6WIxNM
FastAPI courses by Michael: https://training.talkpython.fm/fastapi-courses
Listen this episode on Talk Python: https://talkpython.fm/episodes/show/353/sqlmodel-the-new-orm-for-fastapi-and-beyond
Episode transcripts: https://talkpython.fm/episodes/transcript/353/sqlmodel-the-new-orm-for-fastapi-and-beyond
▬▬▬▬ Dive deeper ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Listen to the Talk Python To Me podcast at https://talkpython.fm Over 250 hours of Python courses at https://training.talkpython.fm/courses Follow us on on Mastodon. Michael: https://fosstodon.org/@mkennedy & Talk Python https://fosstodon.org/@talkpython