No video

FastAPI Python framework - SQLAlchemy and Database integration

  Рет қаралды 24,423

BugBytes

BugBytes

Күн бұрын

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:
ko-fi.com/bugb...
𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📖 Blog: www.bugbytes.i...
👾 Github: github.com/bug...
🐦 Twitter: / bugbytesio
📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
HTMX CDN: htmx.org/docs/...
FastAPI docs: fastapi.tiango...
FastAPI & relational databases: fastapi.tiango...
FastAPI events: fastapi.tiango...
FastAPI headers: fastapi.tiango...
FastAPI templates: fastapi.tiango...
#fastapi #python #sqlalchemy

Пікірлер: 17
@savroful
@savroful 2 жыл бұрын
This channel is totally underrated! Thank you for providing us that knowledges!
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thank you very much! I'm glad you like the videos!
@busayoalabi1690
@busayoalabi1690 2 жыл бұрын
Thank you so much for this especially the htmx part
@bugbytes3923
@bugbytes3923 2 жыл бұрын
You’re welcome, thank you for the comment! Might do some more HTMX + FastAPI content soon.
@and4828
@and4828 2 жыл бұрын
Exactly what I was looking for. Great thanks!
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thank you!
@seydinaoumarsamabaly1806
@seydinaoumarsamabaly1806 2 жыл бұрын
Mate you are a goat 😌. Your content are just priceless 🙌
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Thank you mate! 😁
@Glitche333
@Glitche333 4 ай бұрын
Unfortunately the Github repo for video2 hasn't been uploaded. I love the videos though, they the perfect pace!
@yomajo
@yomajo 2 жыл бұрын
Can we all agree the way flask handles connections with SQLAlchemy is way cleaner than FastAPI?
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Flask does have the benefit of good integration packages with SQLAlchemy. FastAPI probably has some catching up to do, but I don't think it's too bad, personally. Maybe SQLModel will help here too...
@niquedegraaff
@niquedegraaff 5 ай бұрын
FastAPI is async ;) @@bugbytes3923
@Eukiseioh
@Eukiseioh 2 жыл бұрын
Excellent videos about FastAPI! thanks for that awesome content, i learned much with you. Its a lot to ask, what software did you use to record screen with yourself inside the circle? 😅😇
@bugbytes3923
@bugbytes3923 2 жыл бұрын
Hey, thank you, I'm glad you liked the FastAPI stuff. I'll release more in the next few weeks. The circle is added when editing the videos, via some cropping. The software was Adobe Premiere Pro, but any video editing software would allow you to do something like this I'm sure!
@Eukiseioh
@Eukiseioh 2 жыл бұрын
@@bugbytes3923 Thanks! a system CRUD or Forms will be well in some release 🙂
@Maik.iptoux
@Maik.iptoux Ай бұрын
Can you please create an update about the fastapi events? i don't get it with the lifespan...
Joker can't swim!#joker #shorts
00:46
Untitled Joker
Рет қаралды 38 МЛН
Comfortable 🤣 #comedy #funny
00:34
Micky Makeover
Рет қаралды 16 МЛН
Harley Quinn lost the Joker forever!!!#Harley Quinn #joker
00:19
Harley Quinn with the Joker
Рет қаралды 27 МЛН
艾莎撒娇得到王子的原谅#艾莎
00:24
在逃的公主
Рет қаралды 48 МЛН
Writing My Own Database From Scratch
42:00
Tony Saro
Рет қаралды 206 М.
Raw SQL, SQL Query Builder, or ORM?
16:19
ArjanCodes
Рет қаралды 98 М.
SQLAlchemy: The BEST SQL Database Library in Python
16:39
ArjanCodes
Рет қаралды 62 М.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 190 М.
I've been using Redis wrong this whole time...
20:53
Dreams of Code
Рет қаралды 352 М.
FastAPI & Alembic - Database Migrations in FastAPI apps
18:33
Pydantic Tutorial • Solving Python's Biggest Problem
11:07
pixegami
Рет қаралды 262 М.
SQLModel is the Pydantic inspired Python ORM we’ve been waiting for
8:36
John Watson Rooney
Рет қаралды 30 М.
Joker can't swim!#joker #shorts
00:46
Untitled Joker
Рет қаралды 38 МЛН