Create A REST API with FastAPI, SQLAlchemy and PostgreSQL.
FastAPI is a Python framework and set of tools that allow developers to invoke commonly used functions using a REST interface.
SQLAlchemy is a package that makes it easier for Python programs to communicate with databases. Most of the time, this library is used as an Object Relational Mapper (ORM) tool, which automatically converts function calls to SQL queries and translates Python classes to tables on relational databases.
Many web, mobile, geospatial, and analytics applications use PostgreSQL as their primary data storage or data warehouse.
In this video, I build a simple REST API using the above technologies.
If you have learned from this video, please like comment , like and share.
Do not forget to subscribe to the channel for content like this in the future.
Timestamps
0:00 Introduction and project set up
2:05 Implement simple routes
3:26 Running with uvicorn
8:22 Creating a schema with Pydantic
15:56 Creating optional query parameters
19:35 Setting up PostgreSQL with SQLAlchemy
27:05 Creating database model with SQLAlchemy
39:55 Write database model to database
42:37 Create the CRUD routes
47:53 Get all items
51:24 Create an item
52:12 Setting response status code
58:09 Raising Http exceptions
1:02:28 Get one item
1:04:55 Update an item
1:10:25 Delete an item
1:18:40 Documenting the API with Swagger and Redoc
1:20:00 Wrapping Up
SOURCE CODE:
Github:
Twitter:
1 view
297
88
3 weeks ago 00:00:00 1
Mojave - Live from Coachella 2025
4 weeks ago 01:58:13 1
Stive Morgan и Евгений Соколовский - Лучшие Хиты
4 weeks ago 01:03:53 1
#Panodrama - An Exposé of the Fake News BBC!
1 month ago 00:03:44 18
. 2: HEART OF CHORNOBYL | 1980’s LIVE-ACTION MOVIE
1 month ago 00:11:43 1
Revolutionizing Interior Design with AI: A Stunning Demo
1 month ago 00:02:24 3
AIPodcasts Review: Create Podcasts in Minutes with AIPodcasts! 🎙️
1 month ago 00:01:44 1
NEW AD: THE SWEAT ACT
1 month ago 00:02:10 1
Hood Dreams: 2025’s Unfiltered Hustle Rap Anthem
1 month ago 00:02:51 2
Trump’s Beach Party: I’m Not Here to Relax
1 month ago 00:02:36 1
NEW SINGLE - DOWN IN EL SALVADOR
1 month ago 00:00:51 2
Trump, Putin, and Kim Jong Un Perform ’Stayin’ Alive’ | AI Remix
1 month ago 00:02:32 1
The Sponsored White House Easter Egg Roll
1 month ago 00:03:03 1
Make the Hood Great Again: 2025’s Unfiltered Underground Rap Anthem
1 month ago 00:01:42 2
NEW AD: . (Donald’s Internet Technology Zone)
1 month ago 00:02:03 2
Survival Flight: Part 1 | Political AI Music Video
1 month ago 00:02:44 1
National Embarrassment (National Treasure parody)
1 month ago 00:12:59 1
DIY | macrame tassel key chain | 마크라메 태슬 키 체인
1 month ago 00:15:46 2
Hair grows like crazy and doesn’t fall out,🌿an old grandmother’s recipe!
1 month ago 00:00:00 1
Create Your Own Gemstone Refractometer At Home Easily #gemstone #refractometer @sunmoonbay
1 month ago 00:10:01 18
Beautiful Lighting & Shading in After Effects with Layer Styles
1 month ago 00:04:06 12
Better Animated Grain Texture | After Effects Tutorial
1 month ago 00:00:00 5
Relaxing Jazz Instrumental Music & Cozy Rainy Ambience 🌧️ Smooth Jazz for Stress Relief, Unwinding
1 month ago 03:39:23 2
Whiskey Blues - Elegant Music for a Relaxing Background | Smooth Blues & Jazz Ballads