📦 Persist your data with SQLite!
In this video, we connect our Flask API to a real database using SQLite. You’ll learn how to create a products.db file, write SQL queries with Python, and replace your in-memory lists with persistent storage — perfect for real-world apps!
Previous Project files: https://github.com/NDCSwift/Swift-Pro...
🔧 What You’ll Learn:
✅ How to create and connect to a SQLite database
✅ How to create tables using raw SQL
✅ How to replace in-memory storage with real persistence
✅ How to use Postman to test your API
🛠 Tools Used:
Python 3
Flask
SQLite (built-in)
VS Code
DB Browser for SQLite https://sqlitebrowser.org/
Postman or curl🔥 Download My Project Files
👉 Get the source code here:
🔗 https://ndcswift.github.io/Swift-Proj...
⏱️ Timestamps:
00:00 – Intro
01:12 – SQLite
01:31 – Creating a database connection
02:51 – Defining our product table
06:33 – Rewriting the POST route
08:55 – Rewriting the GET route
10:14 – Testing everything with Postman
15:00 – Moving your Data base
16:02 – SQLite browser
16:28 – Updating database connection (After moving file)
18:05 – Recap & what’s next