Learn Prisma In 60 Minutes

Поделиться
HTML-код
  • Опубликовано: 10 янв 2025

Комментарии • 440

  • @AliAliOxenFree
    @AliAliOxenFree Год назад +102

    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 2 года назад +45

    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.

  • @n3x404
    @n3x404 2 года назад +179

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

    • @extremeweirdness1528
      @extremeweirdness1528 Год назад +9

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

    • @vikashviraj1232
      @vikashviraj1232 Год назад +4

      Fun fact: He use hair wigggg 😂

    • @Vietnamcamping89
      @Vietnamcamping89 Год назад +7

      He is used css bro 😅

    • @n3x404
      @n3x404 Год назад

      @@extremeweirdness1528 lmaooo

    • @n3x404
      @n3x404 Год назад

      @@vikashviraj1232 I’m gonna buy it 😂

  • @t3dotgg
    @t3dotgg 2 года назад +89

    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 2 года назад +2

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

    • @curiouslycory
      @curiouslycory 2 года назад +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 2 года назад +1

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

    • @psyferinc.3573
      @psyferinc.3573 11 месяцев назад

      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

  • @masuya444
    @masuya444 Год назад +9

    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 Год назад +1

      You can, use another account

  • @JuanMoisesTorrijos
    @JuanMoisesTorrijos 7 месяцев назад +3

    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!!

  • @Alex_agamer
    @Alex_agamer 2 года назад +53

    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 2 года назад +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.

  • @gabrielpedroza1346
    @gabrielpedroza1346 2 года назад +159

    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 2 года назад +50

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

    • @lukausalj7630
      @lukausalj7630 2 года назад +4

      +1 for this

    • @outis99
      @outis99 2 года назад +4

      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 2 года назад +1

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

    • @nexxel
      @nexxel 2 года назад +19

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

  • @Patrick33456
    @Patrick33456 2 года назад +17

    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 Год назад

      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 Год назад

      @@astkh4381 plz google it

  • @nikhil182
    @nikhil182 2 года назад +21

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

    • @moodyhamoudi
      @moodyhamoudi 9 месяцев назад

      respectfully why do you need a database for a portfolio site

    • @nikhil182
      @nikhil182 9 месяцев назад

      @@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 9 месяцев назад

      @@nikhil182 very cool, thank you

  • @unknownplayer-c1i
    @unknownplayer-c1i Год назад +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 Год назад

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

  • @lukebonnici5627
    @lukebonnici5627 2 года назад +6

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

  • @j_s_bxpert6160
    @j_s_bxpert6160 11 месяцев назад

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

  • @siddhantgupta6719
    @siddhantgupta6719 2 года назад +11

    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

  • @wusswuzz5818
    @wusswuzz5818 Год назад +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.

  • @RishaBhandari
    @RishaBhandari 2 года назад +7

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

  • @sourenasahraian2055
    @sourenasahraian2055 10 месяцев назад +5

    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.

  • @Qw4z1
    @Qw4z1 2 года назад

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

    • @astkh4381
      @astkh4381 Год назад

      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?

  • @fadygamilmahrousmasoud5863
    @fadygamilmahrousmasoud5863 Год назад

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

  • @jaikushwaha1012
    @jaikushwaha1012 11 месяцев назад

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

  • @sgtproper
    @sgtproper 8 месяцев назад

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

  • @frankylopez4477
    @frankylopez4477 Год назад

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

  • @bandinopla
    @bandinopla 2 года назад +3

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

  • @wfl-junior
    @wfl-junior 2 года назад +4

    36:36 why not add an on delete cascade to the UserPreference -> User relation?

  • @mustafa-ahmed-dev
    @mustafa-ahmed-dev Год назад

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

  • @bmejia220
    @bmejia220 2 года назад +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 2 года назад +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 :)

  • @josebladex
    @josebladex Год назад

    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.

  • @Crogoch16
    @Crogoch16 Год назад +1

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

  • @mSpinks01
    @mSpinks01 2 года назад

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

  • @sefatanam
    @sefatanam Год назад

    A compact, mighty tutorial of prisma

  • @abramboutros7672
    @abramboutros7672 2 года назад

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

  • @tw04
    @tw04 2 года назад

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

  • @carltongordon
    @carltongordon 2 года назад

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

  • @duke4279
    @duke4279 Год назад

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

  • @blazi_0
    @blazi_0 Год назад

    I just see the future of backend development blown away with capabilities of Prisma ! Just Wow

  • @TheUnwokeFool
    @TheUnwokeFool Год назад +2

    I have tried this twice. Both times I got to 12:38 and get the error "error: Environment variable not found: DATABASE_URL."
    This is strange because it is defined in .env and the migration created the users table so the DATABASE_URL is correct
    Any advice?

    • @UtaKuon
      @UtaKuon Год назад +1

      What are you using to build the app? Some tools require you to add a prefix for environment variables to work.
      if you're using Vite you must add "VITE_" in the name of the variable, so in your case it'd become "VITE_DATABASE_URL"

    • @okkkk88612
      @okkkk88612 Год назад

      same problem have you fixed it?

    • @prasanjithlorensuhewa6689
      @prasanjithlorensuhewa6689 Год назад

      @@okkkk88612 did you fix it ?

    • @ΣτάθηςΣταθόπουλος-σ7ρ
      @ΣτάθηςΣταθόπουλος-σ7ρ Год назад +1

      Same problem no solution so far...

  • @danielnavarrete8571
    @danielnavarrete8571 Год назад +1

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

  • @adimaralimuddin96
    @adimaralimuddin96 2 года назад

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

  • @mcoria74
    @mcoria74 Год назад

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

  • @VitorVelosoSA
    @VitorVelosoSA Год назад

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

  • @shashishekhar4999
    @shashishekhar4999 Год назад

    I cannot thank you enough for this ❤ , there are folks creating a whole 10 hour course and cover exactly this much content. You are a GEM creating compact, filled and useful videos in practicle sense. Super thanks from India!

  • @vladmehedintu5912
    @vladmehedintu5912 9 месяцев назад

    Great video🎉

  • @balaganesh3440
    @balaganesh3440 2 года назад

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

  • @ultragigachader
    @ultragigachader 2 года назад +1

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

  • @workflowinmind
    @workflowinmind 2 года назад +2

    A deep prisma tutorial by Kyle?? Yes please

  • @ritavdas7570
    @ritavdas7570 Год назад

    Such a detailed yet concise video !

  • @rachidb9624
    @rachidb9624 2 года назад

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

  • @ignaciomartinezavila5693
    @ignaciomartinezavila5693 10 месяцев назад +1

    Incredible! What a great video.
    Could you please explain the integration with Graphql?

  • @iamhelllover
    @iamhelllover 2 года назад

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

  • @kartikfire
    @kartikfire 2 года назад

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

  • @sunilanthony17
    @sunilanthony17 11 месяцев назад

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

  • @cone2571
    @cone2571 Год назад

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

  • @charlesbabbage6786
    @charlesbabbage6786 9 месяцев назад

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

  • @nytechbro
    @nytechbro 2 года назад +1

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

  • @jasonlough6640
    @jasonlough6640 6 месяцев назад

    @33:20 or so, on a mac, in vscode,
    cmd+shift+p, then click "developer reload window"
    fixes it (refreshes it as well)
    Ive also had instances where I reserve to fix.

  • @mikhalpalych
    @mikhalpalych Год назад

    The only comprehensive one, nice, thank you dude

    • @mikhalpalych
      @mikhalpalych Год назад

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

  • @TimKariuki
    @TimKariuki Год назад

    Very comprehensive Prisma crash course very well delivered.

  • @davelag7838
    @davelag7838 2 года назад

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

  • @Lenny_Malcolm0
    @Lenny_Malcolm0 11 месяцев назад

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

  • @roaring_cannon
    @roaring_cannon Год назад

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

  • @DEV_XO
    @DEV_XO 2 года назад

    Amazing mate, as always!

  • @splitpierre
    @splitpierre 2 года назад +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!

  • @bxlbjorn
    @bxlbjorn Год назад

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

  • @JohnSmith-vs9oe
    @JohnSmith-vs9oe 2 года назад +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! 😃

  • @brown-programmer
    @brown-programmer Год назад

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

  • @NilanjanH
    @NilanjanH 10 месяцев назад

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

  • @kastenkarsten
    @kastenkarsten 2 года назад

    Wow, this video was freaing incredible! I was looking for an introduction to the most used ORMs around and you provided an mind-blowing deep-dive.
    But I have a few things to criticize:
    1. When you tried to delete the user and userPreferences: It would have been way better to use the resp. delete function for the preferences first. As same as you would do when "cleaning" the DB usually.
    2. The way of presentation: Don't get me wrong, your voice and the way everything is shown is perfectly fine. But you should consider talking a bit slower and also don't move around so much. It feels pretty hectic as if you're in a rush watching you live during the presentation. Slow down and chill a bit, we do not run away :)
    Anyway, overall 20 / 10 rating. Thanks for your amazing work!

  • @angshu7589
    @angshu7589 2 года назад +7

    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

    • @TheLifeIsGoodTV
      @TheLifeIsGoodTV 2 года назад

      not really

    • @angshu7589
      @angshu7589 2 года назад +1

      @@TheLifeIsGoodTV well that's what they said about TypeScript

    • @carlonnrivers
      @carlonnrivers 2 года назад +2

      Looking forward to it!

    • @bigmistqke
      @bigmistqke 2 года назад +1

      Cool got a repo?

  • @yoitsba
    @yoitsba 2 года назад +6

    I loved this tutorial, one thing I didn't understand is why you reconfigured the user preferences so they'd delete. Does Prisma not have a modifier for cascading?

  • @rahatsshowcase8614
    @rahatsshowcase8614 2 года назад

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

  • @8koi245
    @8koi245 Год назад

    33:00 AHHH TYSM!! I was having it rough without the updated types :c

  • @densel.c8935
    @densel.c8935 7 месяцев назад

    Solid tutorial , it was very easy to follow along.

  • @ЛевНефедов-б2ы
    @ЛевНефедов-б2ы Год назад

    What extensions do you use? I didn't get hints like yours 33:18 even tho I'm using typescript and prisma extensions

  • @LuisFelipe-td8qk
    @LuisFelipe-td8qk 2 года назад +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!

  • @hectorserrano9314
    @hectorserrano9314 2 года назад +5

    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? 🤔

    • @anhedonie92
      @anhedonie92 Год назад +1

      I noticed the same, it's a model mistake but it doesn't really matter, he just wanted to show multiple relationships.

  • @anishadhikari3690
    @anishadhikari3690 2 года назад

    Great comprehensive tutorials. Thank you!

  • @yasserhy
    @yasserhy 2 года назад +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 :)

  • @alexandramoldovan5473
    @alexandramoldovan5473 11 месяцев назад

    This course is better than documentation itself! 😊 I am waiting for a react-graphql project 💪

  • @parnasmi
    @parnasmi Год назад

    Great tutorial to learn Prisma. Thank you!

  • @pablom2274
    @pablom2274 Год назад

    0:19 missing self relations! ahah thanks for the video!

  • @gerryramosftw
    @gerryramosftw Год назад

    I'm only 20 minutes in but damn is this thing super helpful, thank you for making this

  • @許永昕
    @許永昕 2 года назад

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

  • @ryanyoung1925
    @ryanyoung1925 Год назад

    Kyle, you always do the best!

  • @heguer87
    @heguer87 Год назад

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

  • @jonzuka9746
    @jonzuka9746 2 года назад

    You are a genius content creator! 👍

  • @annismonadjem6901
    @annismonadjem6901 2 года назад +1

    Kyle, Thank you this course is amazing.

  • @omar-elgammal
    @omar-elgammal Год назад

    That is just great! plese do more of those one hour crash courses

  • @jeetchheda3675
    @jeetchheda3675 Год назад

    30:31 bro, i want to define an enum such that the values in this enum are strings with more than 1 words. How do i do that ?

  • @bikerd12
    @bikerd12 Год назад

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

  • @tadeuszjiwu255
    @tadeuszjiwu255 2 года назад

    Great work Kyle, thank You!

  • @rtorcato
    @rtorcato Год назад +1

    in vscode: command shift p -> Then select Typescript restart TS server. That will fix if the types don't refresh. You must be in a TS file or tsconfig to see this command appear.

  • @BorisDutkin-f5b
    @BorisDutkin-f5b Год назад +1

    If after npx prisma generate you can't see the correct autocompletion for the types, on vscode you can cmd+shift+p => TypeScript: Restart TS Server

  • @cyb3ristic
    @cyb3ristic Год назад

    watched the entire video, great content 👍🏻

  • @xenyens
    @xenyens Год назад

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

  • @porsche-911-turbos
    @porsche-911-turbos 9 месяцев назад

    when i see this man make a video on the topic im researching i close all the other tabs

  • @AtomicCodeX
    @AtomicCodeX 2 года назад

    This video was so amazing, it reminded me of mongoose
    Thank you Kyle!!

  • @sourabhsingh4515
    @sourabhsingh4515 3 месяца назад

    at 33:25 you could've just restarted the typescript server or reloaded the window instead of closing the file or reopening vs code it does the work for me

  • @anatholekaringanire7649
    @anatholekaringanire7649 Год назад

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

  • @paei4906
    @paei4906 2 года назад

    your explanations are the best, thank you for your work