Learn Prisma In 60 Minutes

preview_player
Показать описание
Prisma is an incredibly popular ORM and for good reason. It is feature rich, type safe, and built on modern JavaScript concepts. The only downside is it is quite complicated to learn at first which is where this video comes in. I will be teaching you everything you need to know to get up and running with Prisma in just 60 minutes.

Thank you Prisma for providing professional captions for this video!

📚 Materials/References:

🌎 Find Me Here:

⏱️ Timestamps:

00:00 - Introduction
01:12 - Project Setup
02:35 - Prisma Setup
06:38 - Basic Prisma Model Setup
07:56 - Prisma Migration Basics
09:11 - Prisma Client Basics
14:10 - Datasources and Generators
15:12 - Model Fields
19:19 - Model Relationships
26:16 - Model Attributes
29:55 - Enums
32:40 - Client Create Operations
40:15 - Client Read Operations
45:11 - Advanced Filtering
49:28 - Relationship Filtering
52:07 - Client Update Operations
55:02 - Connect Existing Relationships
57:52 - Client Delete Operations

#Prisma #WDS #Database
Рекомендации по теме
Комментарии
Автор

This is an hour long video, but honestly there's like 6 hours of content here. You have done a fantastic job. Prisma is tuly amazing!

AliAliOxenFree
Автор

This guy has same haircut for years, like not even an hair goes in wrong direction 😂, love you bro tnx 💪❤️

nx
Автор

This couldn’t have been a better timing. There is a new stack called t3-stack which uses nextjs, typescript, tailwind and tRPC. I WOULD LOVE you to create a video on tRPC because it simplifies and removes a shit ton of backend code. It also removes the schema so no graphQL because typescript safely infers the types so all you need to do is call the backend function and you’re good to go

gabrielpedroza
Автор

Hey Kyle, great vid. One note though: In around 29:00 you create an index on email, but you already have the unique constraint, which will create an index for you (unique constraints are basically an index with extra functionality). So all that sorting or filtering will already use the index, and you just add duplicate second index on the same field.

matzesox
Автор

Such a fantastic job of teaching prisma, no useless sidetracks, to the point. This is gold. I would give it way more than one like if I can!

masuya
Автор

I accidentally clicked on the notification but i learned what prisma is and this video is actually really useful to me Thank you

Alex_agamer
Автор

Just five minutes into your video and I've already received assistance with my formatter! This was much needed! I appreciate it, thanks a lot!!

JuanMoisesTorrijos
Автор

This is pure gold! I want to use prisma for my personal portfolio website. This video really helps! Thank you Kyle✨

nikhil
Автор

I don't often leave comments but this video (and many others) was extremely helpful and to the point. This is the perfect way to learn something like Prisma and I'm tremendously grateful to you. There's so many people putting out content like this but you're one of the best. You make everything super approachable and have a knack for going in depth without being overwhelming.

You've got a gift, keep on doing your thing man!

Patrick
Автор

Yeah prisma's pretty cool

Quick hot take - migrations kinda suck and `npx prisma db push` w/ a db branch model (like planetscale) is a way better dx IMO

tdotgg
Автор

Thanks to your video I was able to create a complex database when I have never written an SQL line in my life.
Thank you so much for this video, Prisma is amazing!

scalitics
Автор

Other alternatives to switching around the one-to-one relationship is
a) when deleting, delete the dependent (preference) table first then the main table
b) in the dependent table (preference) on the relationship put a cascade delete. In this case only need to delete the user table and it will auto delete related entry in the preference table.

wusswuzz
Автор

Did anyone else notice that when he logged the generated raw queries by Prisma, no join was taking place between the related tables, rather, instead of the join, it generated two back to back select queries between the related tables which means Prsima must be joining them through it's query engine as opposed to delegating the joins to the database engine in the application layer, this could have serious performance ramifications.

sourenasahraian
Автор

Thanks a bunch for this tutorial! It was a super crash course that got me up to speed. Keep doing what you're doing and all the best :)

lukebonnici
Автор

Thank you for all the efforts that you put into creating such informative videos. It really helps a lot. Keep it up Kyle

RishaBhandari
Автор

Hey Kyle! Thanks for the Great video.

Just a recommendation: for nodejs tutorials, you can put the VS code terminal on the right side instead of bottom, so both code and output is clearly visible.

Keep up the amazing work

siddhantgupta
Автор

Nice and thorough tutorial. The others ones kinda jumped in fast or implemented prisma into prebuilt projects. I've never seen it before, so it's nice to get a rundown on how everything works with configuration :)

miscany
Автор

In the model relationship that you pointed out between User & Post - for the favoritedBy section. Wouldn't that be a many to many relationship? A Post could be favorited by Multiple Users couldn't it? 🤔

hectorserrano
Автор

Nice video! I've never seen someone else research the prisma schema language that thoroughly!

It's incredibly telling that it takes an entire hour to fully teach all of it, but that's why we're (me and a friend) are making a _*GUI for writing Prisma Schemas* (in development). I wonder if anyone else would benefit from that.

This is mostly useful for larger projects, where a normal prisma schema could be 300+ lines long

Please do leave any thoughts in the comments

angshu
Автор

34:16 you can also Restart the Typescript server using the command palette

bandinopla