Fetch All Jobs from Database in Next.js (Drizzle ORM + Inner Join + Conditions)

Thapa Technical
Thapa Technical
63 followers
Jan 26, 2026

📂 Source Code
👉 GitHub Repo: https://github.com/thapatechnical/job-portal-nextjs

----------------------------------------------
In this video, you’ll learn how to fetch all employers’ job posts from the database and show them inside the Applicant Dashboard (Find Jobs page) in a Next.js Job Portal App.

We will build a real production-style DB query using Drizzle ORM, apply filters/conditions like:

show only active jobs

hide deleted jobs

exclude expired jobs

return the latest jobs first

We’ll also use INNER JOIN to combine data from multiple tables like jobs, employers, and users (company logo + company name), then we’ll loop the jobs and render them in a simple UI layout.

This is exactly how real job portals fetch job listings.
------------------------------------------------------------------------------------

🔗 Useful Playlists

📘 Next.js Full Stack Playlist:
https://youtube.com/playlist?list=PLwGdqUZWnOp0lwvSBaIzzgV9X0ZiZ-42O&si=aQ_TNBNNx5L7V_bn

⚛️ React.js Playlist:
https://youtube.com/playlist?list=PLwGdqUZWnOp1Rab71vx2zMF6qpwGDB2Z1&si=sDZRxsYNetYmojKd

💻 TypeScript Playlist:
https://youtube.com/playlist?list=PLwGdqUZWnOp0xfHQFmlL52b_6-QZ0mnk_&si=c4jfsd5ElDC1p0A5
------------------------------------------------------------------------------------
💸 Get All My YouTube Videos' Source Code for just ₹199! Grab Now - https://thapatechnical.shop/source-code

📺 Watch the complete Node.JS Playlist here :https://youtube.com/playlist?list=PLwGdqUZWnOp3KELplHtc-RnJ5xTUPqdgH&si=_ob8F88HYxCdspup

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

🚀 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 Fetching all employer job posts (Applicant Dashboard)
1:30 Support my channel ❤️
1:50 Jobs page folder structure (Next.js App Router)
3:20 UI preview (Jobs Card Layout)
4:00 Creating getAllJobs() DB Query
4:20 What our function should return (Job Card Data)
7:20 Understanding INNER JOIN in Drizzle ORM
10:00 Adding conditions (deletedAt + expiresAt filters)
11:10 What our function returns (type-safe data)
11:30 Fetch data + loop through jobs in UI
13:20 Next video update / what’s coming next