FastAPI Python framework - SQLAlchemy and Database integration

Published: 20 February 2022
on channel: BugBytes
33,151
588

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:
   • FastAPI  

📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
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/fastap...
🐦 Twitter:   / bugbytesio  

📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
HTMX CDN: https://htmx.org/docs/#installing
FastAPI docs: https://fastapi.tiangolo.com/
FastAPI & relational databases: https://fastapi.tiangolo.com/tutorial...
FastAPI events: https://fastapi.tiangolo.com/advanced...
FastAPI headers: https://fastapi.tiangolo.com/tutorial...
FastAPI templates: https://fastapi.tiangolo.com/advanced...

#fastapi #python #sqlalchemy


On this page of the site you can watch the video online FastAPI Python framework - SQLAlchemy and Database integration with a duration of hours minute second in good quality, which was uploaded by the user BugBytes 20 February 2022, share the link with friends and acquaintances, this video has already been watched 33,151 times on youtube and it was liked by 588 viewers. Enjoy your viewing!