Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Prisma in Next.js - My Favorite Way to Work with Databases - CRUD, Dev/Prod Workflow, Relations, Indexes

ByteGrad via YouTube

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn how to integrate Prisma with Next.js applications through this comprehensive tutorial covering database operations, development workflows, and production deployment. Explore Next.js architecture fundamentals before diving into Prisma setup and schema design, including essential concepts like unique constraints, mapping, and indexing. Master CRUD operations by implementing GET requests with findMany and findUnique methods, along with POST, PUT, and DELETE operations for complete data manipulation. Discover advanced database relationships including one-to-many, many-to-many, and one-to-one associations, plus learn how to query related data using include and connect methods. Practice essential development workflows including database seeding, error handling, and type safety with Prisma-generated types. Understand caching strategies in Next.js applications and explore Prisma Accelerate for enhanced performance. Navigate the transition from development to production environments, covering database migrations, deployment to Vercel, and the differences between serverless and edge runtime environments. Gain insights into advanced features like Prisma Pulse and middleware implementation for edge computing scenarios.

Syllabus

00:00 Intro
01:07 Next.js architecture
02:02 Example app overview
03:15 Setup Prisma
06:09 Schema fundamentals
07:36 Prisma extension + defaultFormatter
08:34 Schema fundamentals continued
10:09 Create database
12:38 View database content Prisma Studio
14:13 GET data on page findMany
16:50 Prisma Client instantiation
18:29 GET data on page findUnique
22:18 Changing schema Slug - npx prisma db push
25:38 @unique
27:42 @map
28:04 @index
28:53 Filtering where
29:55 Ordering
30:18 Select
31:00 Pagination
32:29 Count
33:42 Writing data POST / PUT / DELETE
42:03 Relations one-to-many
43:54 Many-to-many
44:27 One-to-one
46:50 include & connect relations queries
49:12 Seeding database
51:10 Prisma types
53:13 Seeding database continued
55:50 Error handling
57:35 Caching in Next.js
59:59 Prisma Accelerate caching
1:00:34 Going to production
1:04:32 Migrations
1:06:15 npx prisma migrate
1:08:18 postinstall prisma generate
1:08:42 Push to Vercel
1:10:19 Serverless vs Edge
1:10:59 Middleware edge
1:13:07 Prisma Pulse

Taught by

ByteGrad

Reviews

Start your review of Prisma in Next.js - My Favorite Way to Work with Databases - CRUD, Dev/Prod Workflow, Relations, Indexes

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.