Learn Prisma In 60 Minutes

Sdílet
Vložit
  • čas přidán 16. 05. 2024
  • 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:
    How To Install Node.js Video: • Your First Node.js Web...
    Prisma Documentation: www.prisma.io/docs/getting-st...
    Async/Await Video: • JavaScript Async Await
    Async/Await Article: blog.webdevsimplified.com/202...
    MongoDB Crash Course Video: • MongoDB Crash Course
    MongoDB Crash Course Article: blog.webdevsimplified.com/202...
    Mongoose Crash Course Video: • Mongoose Crash Course ...
    🌎 Find Me Here:
    My Blog: blog.webdevsimplified.com
    My Courses: courses.webdevsimplified.com
    Patreon: / webdevsimplified
    Twitter: / devsimplified
    Discord: / discord
    GitHub: github.com/WebDevSimplified
    CodePen: codepen.io/WebDevSimplified
    ⏱️ 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

Komentáře • 407

  • @n3x404
    @n3x404 Před rokem +107

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

    • @extremeweirdness1528
      @extremeweirdness1528 Před 9 měsíci +4

      Fun fact I got confused between web dev cody and him and I thought he lost his hair in the present 😂.

    • @vikashviraj1232
      @vikashviraj1232 Před 8 měsíci +2

      Fun fact: He use hair wigggg 😂

    • @Vietnamcamping89
      @Vietnamcamping89 Před 5 měsíci +2

      He is used css bro 😅

    • @n3x404
      @n3x404 Před 5 měsíci

      @@extremeweirdness1528 lmaooo

    • @n3x404
      @n3x404 Před 5 měsíci

      @@vikashviraj1232 I’m gonna buy it 😂

  • @t3dotgg
    @t3dotgg Před rokem +69

    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

    • @umoooo
      @umoooo Před rokem +2

      its cool to see you here, I first learnt about prisma in your link shortener video. It was awesome!

    • @curiouslycory
      @curiouslycory Před rokem +1

      Do you have any videos or can you recommend any docs regarding this? I'm kinda stuck on the whole migration thing. Dev migrations work great, but translating those changes to prod seems to be really unclear to me. Running deploy from vercel tells me that there's no changes and the error log says I should baseline. Ultimately I ended up changing my connection on my local machine to the prod database and resolving all of the migrations, but didn't seem like the correct way to do it.

    • @arlandmv4053
      @arlandmv4053 Před rokem

      Hello, can you say why do they suck? I would like to know..

    • @psyferinc.3573
      @psyferinc.3573 Před 3 měsíci

      i forgot where but i managed to create some scripts that have the migration and pushing set @@curiouslycory
      "prismaPush": "dotenv -e .env.local npx prisma db push ",
      "prismaMigrate": "dotenv -e .env.local npx prisma migrate ",
      "prismaStudio": "dotenv -e .env.local npx prisma studio"
      these are my scripts in my package.json file ( for npm run
      and i installed
      "dotenv": "^16.3.1",
      "dotenv-cli": "^7.3.0",
      one year too late but i feel your pain

  • @AliAliOxenFree
    @AliAliOxenFree Před rokem +69

    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!

  • @matzesox
    @matzesox Před rokem +36

    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.

  • @Alex_agamer
    @Alex_agamer Před rokem +54

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

    • @nairanvac79
      @nairanvac79 Před rokem +2

      I came down to the comments to say the same thing. I thought this was going to be a Figma tutorial, but this is way cooler.

  • @lukebonnici5627
    @lukebonnici5627 Před rokem +5

    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 :)

  • @siddhantgupta6719
    @siddhantgupta6719 Před rokem +9

    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

  • @RishaBhandari
    @RishaBhandari Před rokem +7

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

  • @gabrielpedroza1346
    @gabrielpedroza1346 Před rokem +155

    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

    • @nexxel
      @nexxel Před rokem +49

      maintainer of create-t3-app here. would love if Kyle makes a video using tRPC!

    • @lukausalj7630
      @lukausalj7630 Před rokem +3

      +1 for this

    • @outis99
      @outis99 Před rokem +3

      Literally the reason I'm here and quite surpirsed this is the most upvoted comment lol, I just started playing around with it today and it is amazing! There's some new syntax in v10 which means most videos are outdated but it's not that different, would love a video from Kyle

    • @warsame2245
      @warsame2245 Před rokem

      @@nexxel I doubt it, the creator of tRPC aka Theo made a video making fun of kyle teaching method. dude is sassy

    • @nexxel
      @nexxel Před rokem +18

      @@warsame2245 Theo isn't the creator of tRPC lol.

  • @masuya9915
    @masuya9915 Před rokem +7

    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!

    • @dkras
      @dkras Před rokem +2

      You can, use another account

  • @fadygamilmahrousmasoud5863

    this is one of the best tutorials out there to learn Prisma if you have zero experience with prisma .. amazing tutorial thank you 🙂

  • @bmejia220
    @bmejia220 Před rokem +1

    Kyle youre brilliant man. I love learning from you, you give great practical tips, and details! One of the best developers on youtube. Thank you Kyle!!!

  • @miscany
    @miscany Před rokem +6

    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 :)

  • @ultragigachader
    @ultragigachader Před rokem +1

    Now that is something I will use to setup my next project, thanks Kyle!

  • @nikhil182
    @nikhil182 Před rokem +21

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

    • @moodyhamoudi
      @moodyhamoudi Před měsícem

      respectfully why do you need a database for a portfolio site

    • @nikhil182
      @nikhil182 Před měsícem

      @@moodyhamoudi Good question, I have blog page on my website and I'm storing the likes and views for each of the blog in a DB and displaying the same on the blog page. Additionally I've self hosted a web analytics tool - Umami where I'll also need a DB. I hope this answers you're question:)

    • @moodyhamoudi
      @moodyhamoudi Před měsícem

      @@nikhil182 very cool, thank you

  • @frankylopez4477
    @frankylopez4477 Před 6 měsíci

    Truly the best Prisma tutorial I could find. Always love your videos.

  • @danielnavarrete8571
    @danielnavarrete8571 Před rokem +1

    Great video!, literally everything I needed to complete my project.

  • @jaikushwaha1012
    @jaikushwaha1012 Před 3 měsíci

    Hey Kyle, thankyou so much for making one of the most comprehensive guide on getting started with Prisma

  • @mSpinks01
    @mSpinks01 Před rokem

    Great timing. I am just now learning Prisma and I feel this tutorial is beneficial to getting it off the floor.

  • @anterpants
    @anterpants Před rokem

    Oh nice, I started using Prisma recently and was wondering if there was a tutorial. Really glad I found one from you!

  • @iamhelllover
    @iamhelllover Před rokem

    I've recently started using prisma and I needed a tutorial about it. Thank you for this video

  • @kartikfire
    @kartikfire Před rokem

    Wow! Amazing video! Looking forward for more typescript related tutorials!

  • @ritavdas7570
    @ritavdas7570 Před 7 měsíci

    Such a detailed yet concise video !

  • @rachidb9624
    @rachidb9624 Před rokem

    Very impressive tutorial man, thank you very much !
    Watched it till the end.

  • @AnnieTaylorChen
    @AnnieTaylorChen Před rokem +2

    Tried this when it was its last version. Lots have changed since. I gotta check this out again, definitely in my to watch list. :)

  • @anishadhikari3690
    @anishadhikari3690 Před rokem

    Great comprehensive tutorials. Thank you!

  • @Patrick33456
    @Patrick33456 Před rokem +16

    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!

    • @astkh4381
      @astkh4381 Před rokem

      as i undertsand if you got for example one-to-many realtion you can connect models from both sides?You can make user and connect certain post or you can make post and connect your user?

    • @27sosite73
      @27sosite73 Před 11 měsíci

      @@astkh4381 plz google it

  • @duke4279
    @duke4279 Před 7 měsíci

    Awesome content as always, been following you for years, thanks again Kyle ;)

  • @annismonadjem6901
    @annismonadjem6901 Před rokem +1

    Kyle, Thank you this course is amazing.

  • @abramboutros7672
    @abramboutros7672 Před rokem

    man your subjects are just the best, I LOVE THIS CHANNEL. !!

  • @balaganesh3440
    @balaganesh3440 Před rokem

    Thanks for this. It was extremely useful and massively cut down the up and running time!

  • @LuisFelipe-td8qk
    @LuisFelipe-td8qk Před rokem +2

    Hey Kyle, thanks for your awesome work! Really love your videos. I suggest that you do a video covering GraphQL/Apollo just like this one, it would be great!

  • @davidmogbeyiteren348
    @davidmogbeyiteren348 Před 9 měsíci

    This is super awesome! Thanks a lot, Kyle 🚀🚀

  • @bikerd12
    @bikerd12 Před 8 měsíci

    This is a great tutorial. Kyle, thank you so much.

  • @Qw4z1
    @Qw4z1 Před rokem

    Dude! This is probably the best tutorial on any topic that I've ever seen on CZcams.

    • @astkh4381
      @astkh4381 Před rokem

      as i undertsand if you got for example one-to-many realtion you can connect models from both sides?You can make user and connect certain post or you can make post and connect your user?

  • @VitorVelosoSA
    @VitorVelosoSA Před 11 měsíci

    Perfect video. Now everything is so clean for me. Thank you

  • @user-gf8no4es6m
    @user-gf8no4es6m Před 29 dny

    Very helpful - I usually space out when reading docs or listening to someone talking slowly but somehow you keep me awake lol.

  • @adimaralimuddin96
    @adimaralimuddin96 Před rokem

    i will thank you from the start kyle! you're the man!

  • @mcoria74
    @mcoria74 Před rokem

    Amazing, finally a tutorial well explained, thanks a lot, regards from México :)

  • @Ocdib
    @Ocdib Před 9 měsíci

    Extremely clear! Thank you!!!

  • @wusswuzz5818
    @wusswuzz5818 Před rokem +1

    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.

  • @j_s_bxpert6160
    @j_s_bxpert6160 Před 4 měsíci

    If you want to learn prisma, this tutorial is the best, it covers all you need.

  • @cyb3ristic
    @cyb3ristic Před 9 měsíci

    watched the entire video, great content 👍🏻

  • @scalitics
    @scalitics Před rokem +1

    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!

    • @MaggieAkinsulire
      @MaggieAkinsulire Před 11 měsíci

      You really should learn SQL though, at least just the basics. All of this would make so much more sense.

  • @Crogoch16
    @Crogoch16 Před 8 měsíci +1

    Damn bro! I can't handle that amount of quality 🔥

  • @splitpierre
    @splitpierre Před rokem +2

    Great work thanks.
    Came here looking for some more in-depth/practical cases around using the prisma migrate tool.
    It'd be interesting to see a tutorial talking exclusively on handling migrations considering multiple environments [local,stage,production].
    Keep up the great work!

  • @donmikkodanm.olmillo8154

    Thank you so much for this tutorial! you're a lifesaver

  • @DEV_XO
    @DEV_XO Před rokem

    Amazing mate, as always!

  • @carltongordon
    @carltongordon Před rokem

    every time i start a new tech you pop up with a gem OMG

  • @paei4906
    @paei4906 Před rokem

    your explanations are the best, thank you for your work

  • @yomwoldemichael451
    @yomwoldemichael451 Před rokem +1

    such a great video! I come back to this a lot

  • @tw04
    @tw04 Před rokem

    How did you know I'm just about to use Prisma in my new Team project?? Thank you always man

  • @josebladex
    @josebladex Před 4 měsíci

    i was trying to get a success one to one relation query for many days, and your video was the ligth to get it, thanks so much.

  • @heguer87
    @heguer87 Před rokem

    Thanks for the effort and making our lives a bit easier!😁

  • @danielpark399
    @danielpark399 Před rokem

    beautiful tutorial! it helped me a lot! thank you very much

  • @ivandynysiuk4341
    @ivandynysiuk4341 Před měsícem

    Awesome explanation!
    Thanks man 😎

  • @xenyens
    @xenyens Před 6 měsíci

    Thank you for the update. I appreciate your time in this.

  • @edwarddelgado9654
    @edwarddelgado9654 Před 9 měsíci

    Cool, glad to see you covering thing this.

  • @shaki7888
    @shaki7888 Před rokem

    Another great tutorial, thank you!

  • @anatholekaringanire7649
    @anatholekaringanire7649 Před 9 měsíci

    Much more helpful, you saved me for this contetiful tutorial.

  • @mustafa-ahmed-dev
    @mustafa-ahmed-dev Před rokem

    Thank you so much.
    After I had watched this tutorial, I used Prisma in my graduation project.

  • @w1lkns
    @w1lkns Před 9 měsíci

    Thanks so much for this!

  • @davelag7838
    @davelag7838 Před rokem

    awesome video!!, very well explained, thank you so much for sharing this info, I learned a lot
    Cheers from Central America

  • @tadeuszjiwu255
    @tadeuszjiwu255 Před rokem

    Great work Kyle, thank You!

  • @parnasmi
    @parnasmi Před rokem

    Great tutorial to learn Prisma. Thank you!

  • @brown-programmer
    @brown-programmer Před 5 měsíci

    Thanks for the great video!!!! I was able to do a personal project with the help of this video.

  • @sicro1000
    @sicro1000 Před rokem

    What an excellent course, thank you 👍

  • @user-it4gk4en6u
    @user-it4gk4en6u Před rokem

    this tutorial is very useful for me !! big thanks to you !!!

  • @cone2571
    @cone2571 Před rokem

    Svaka cast na videu, nadam se da ce svima biti jasno kako prismu koristiti, kao sto je meni jasno

  • @sefatanam
    @sefatanam Před rokem

    A compact, mighty tutorial of prisma

  • @aeronwolfe7072
    @aeronwolfe7072 Před rokem

    awesome video! thank you so much for this information!!! good job! love it.

  • @yasserhy
    @yasserhy Před rokem +3

    Amazing course as always. Following you was the best decision I made a while back :) .. By the way, can't we get a copy of your course summary? It will really help as review notes :)

  • @bxlbjorn
    @bxlbjorn Před rokem

    Wow, was about to embark with Mongoose, but after seeing this, and coming from SQL db experience, this is the way forward. Thanks Kyle!

  • @TimKariuki
    @TimKariuki Před rokem

    Very comprehensive Prisma crash course very well delivered.

  • @learner8084
    @learner8084 Před 8 měsíci

    Great Great Video !!! Love it !!! 💗

  • @sajibahmed872
    @sajibahmed872 Před 8 měsíci

    Thank you, This is really awesome

  • @rahatsshowcase8614
    @rahatsshowcase8614 Před rokem

    miniDocumentation of prisma! If you go through its time stamps ! And use which you need if you forget! Superb❤❤

  • @ryanyoung1925
    @ryanyoung1925 Před 10 měsíci

    Kyle, you always do the best!

  • @NilanjanH
    @NilanjanH Před 2 měsíci

    Bravo! Thanks for explaining Prisma from scratch ....🎉🌟😊

  • @ClickmeBrisbane
    @ClickmeBrisbane Před rokem

    Awesome video, i also enjoyed your graphql video from couple years ago. I would love to see a video of graphql and prisma working together.

  • @mikhalpalych
    @mikhalpalych Před 5 měsíci

    The only comprehensive one, nice, thank you dude

    • @mikhalpalych
      @mikhalpalych Před 5 měsíci

      Oh, but when i got to enums part, i didn't actually get, what enums are translated into

  • @Lenny_Malcolm0
    @Lenny_Malcolm0 Před 3 měsíci

    All in 60 minutes🤯... Great tutorial💯❤

  • @benyaminyakobi3652
    @benyaminyakobi3652 Před rokem

    Hi Kyle. Thank you once again!

  • @eddienubes
    @eddienubes Před rokem

    Thanks for vid, useful as always ❤

  • @not_a_human_being
    @not_a_human_being Před 3 měsíci

    Keep making great accessible content!

  • @theisoj
    @theisoj Před rokem +1

    Prisma looks cool! Thanks Kyle!

  • @sunilanthony17
    @sunilanthony17 Před 3 měsíci

    god dam, this is amazing. The documentation for Prisma is fantastic too.

  • @viveksoni3269
    @viveksoni3269 Před 5 měsíci

    Amazing explanation!!

  • @ashutoshsingh8867
    @ashutoshsingh8867 Před rokem

    Awesome man. AWS amplify backend setup is also doing the same stuff like prisma does for us👍

  • @andrewgulin5634
    @andrewgulin5634 Před 9 dny

    Thank you, this was very helpful

  • @nro337
    @nro337 Před rokem

    The legend! Thank you!

  • @henrymunoz2035
    @henrymunoz2035 Před 8 měsíci

    Great project thank you

  • @heitorpaulo5403
    @heitorpaulo5403 Před 10 měsíci

    Hey Kyle, you are an inspiration for me, really.

  • @Paxters_
    @Paxters_ Před rokem

    Love you! You are helping me so much

  • @JohnSmith-vs9oe
    @JohnSmith-vs9oe Před rokem +1

    Top quality tutorial! Really detailed and "simplified". I am not usually writing this kind of messages, a like is usually enough. But I want to express my gratitude. Thank you! 😃

  • @alinawaz4034
    @alinawaz4034 Před rokem +1

    Awesome video, this is what was looking for 💕💘 I have a request, can you make a video on GUN JS DB like this. It is amazing free pear-to-pear DB and people will love it.

  • @charlesbabbage6786
    @charlesbabbage6786 Před měsícem

    This tutorial covers almost all crucial concepts of Prisma. Amazing job 👍🏻👍🏻

  • @bandinopla
    @bandinopla Před rokem +3

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

  • @muradqocayev9941
    @muradqocayev9941 Před 3 měsíci

    You're awesome!!🔥🔥

  • @jonzuka9746
    @jonzuka9746 Před rokem

    You are a genius content creator! 👍