Seed in Database Explained with Real Example (Node.js + MySQL + Drizzle)

Seed in Database Explained with Real Example (Node.js + MySQL + Drizzle)

T
Thapa Technical
May 9, 2025

In this video, we're working on our URL Shortener project built with Node.js, MySQL, and Drizzle ORM.
To demonstrate pagination, we need lots of URL data — but manually adding it is slow.
So, we’ll use Drizzle ORM’s seeding functionality to generate 100 fake short links, all linked to a single user in our database.

🌱 This is called database seeding — it helps create dummy data for testing and development.

🔥 Access Source Code, PPT & Notes here for Free : https://www.thapatechnical.com/2024/11/introduction-to-nodejs.html

📺 Watch the complete Node.JS Playlist here :https://youtube.com/playlist?list=PLwGdqUZWnOp3KELplHtc-RnJ5xTUPqdgH&si=_ob8F88HYxCdspup
------------------------------------------------------------------------
🚀 Boost Your Skills with these Pre-Requisite Videos:

🔗 Best HTML Course - https://youtu.be/5ccq_nLHneE
🔗 Best CSS Course - https://youtu.be/MSICFljRcb4
🔗 JavaScript Basics Course Part 1 - https://youtu.be/13gLB6hDHR8
🔗 JavaScript Advanced Course Part 2 - https://youtu.be/YwsOCN8woA8

------------------------------------------------------------------------
💸 Build Your Own E-commerce Website for Free! - https://www.thapatechnical.com/2024/03/build-complete-ecommerce-website-using.html

------------------------------------------------------------------------
✌️ Join Us!

🚀 Become a Member: Unlock perks, free source code, and more Join Now : https://www.youtube.com/channel/UCwfaAHy4zQUb2APNOGXUCCA/join
📷 Connect on Instagram: https://www.instagram.com/thapatechnical
🗨️ Join Our Discord Server: Hang out with fellow programmers Discord Link: https://discord.gg/MdScmCsua6

------------------------------------------------------------------------

⌛TIMELINE⏳
0:00 – WHAT IS SEEDING IN DATABASE – Drizzle

0:15 – What we have done so far in our Node app

0:44 – Pagination in shortlinks

1:45 – Weird output

2:20 – Pagination & must watch videos

3:40 – What is seeding in database

4:30 – Installing drizzle seed

6:35 – Resetting the database with seed

9:20 – Generating 100 fake data in table

12:30 – How fake data looks like

14:00 – Must watch videos