FastAPI Python framework - SQLAlchemy and Database integration
Описание
This video explains the steps involved in adding a SQLite database to your FastAPI application, and walks through the process of adding SQLAlchemy models and a FastAPI Dependency to allow your FastAPI routes to interact with the database.
A FastAPI startup event is also demonstrated, in order to load dummy data into the database.
Finally, we show how to paginate data with SQLAlchemy, and integrate this with our HTMX-based frontend.
▶️ Full Playlist:
https://www.youtube.com/playlist?list=PL-2EBeDYMIbSppj2GYHnvpZ9W69qmkInS
? ????????:
00:00 Intro
02:28 Database setup with SQLAlchemy
04:18 Creating SQLAlchemy model
06:06 Creating the database tables
08:44 Creating FastAPI database dependency
11:00 Querying database with SQLAlchemy
11:55 FastAPI startup events
15:24 Paginating SQLAlchemy records
☕️ ??? ?? ? ??????:
To support the channel and encourage new videos, please consider buying me a coffee here:
https://ko-fi.com/bugbytes
?????? ?????:
? Blog: https://www.bugbytes.io/posts/
? Github: https://github.com/bugbytes-io/fastapi-htmx-example
? Twitter: https://twitter.com/bugbytesio
? ??????? ??????? ??? ???????????:
HTMX CDN: https://htmx.org/docs/#installing
FastAPI docs: https://fastapi.tiangolo.com/
FastAPI & relational databases: https://fastapi.tiangolo.com/tutorial/sql-databases/
FastAPI events: https://fastapi.tiangolo.com/advanced/events/
FastAPI headers: https://fastapi.tiangolo.com/tutorial/header-params/
FastAPI templates: https://fastapi.tiangolo.com/advanced/templates/
#fastapi #python #sqlalchemy
Рекомендуемые видео



















