Prisma Crash Course

Sdílet
Vložit
  • čas přidán 2. 05. 2024
  • Let's look at Prisma, which is a Node.js & TypeScript ORM & toolkit to interact with your database.
    Written Version:
    www.traversymedia.com/blog/pr...
    Check Out My Courses:
    traversymedia.com
    Timestamps:
    0:00 - Intro & What Is Prisma?
    5:30 - What Is Data Modeling?
    6:28 - Getting Started
    9:38 - The Schema File
    10:36 - User Model
    12:29 - Article Model
    14:13 - Running Migrations
    15:45 - Using The Prisma Client
    16:18 - main() Function
    18:00 - Create a User
    19:40 - Get Users
    20:44 - Create Article & Relate User
    23:16 - Create User & Article With One Query
    27:59 - Loop Through Users & Articles
    31:30 - Update Data
    32:37 - Remove Data
    34:23 - Prisma Studio GUI
  • Věda a technologie

Komentáře • 81

  • @PrismaData
    @PrismaData Před 7 měsíci +140

    Thank you for creating this! Prisma is committed to enhancing the developer experience in data-related work. Courses like this one contribute to expanding our community, which, in turn, empowers us to craft even more effective tools for all of you. Your efforts are truly outstanding! ❤

    • @arogueotaku
      @arogueotaku Před 7 měsíci +1

      Hey @PrismaDev. I have heard a lot of buzz around a certain article pointing out flaws with the current Prisma ORM architecture and how it does its interactions with the DB starting with shipping multiple heavy engines to not supporting native foreign key relations and rather using some kind of emulated ones and a few more performance affecting issues which ultimately made my shy away from it. Are there any truth to those claims and are those being looked into actively?

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

      @@arogueotaku the article you are talking about is written by codedamn team members, and they know their stuff well. Most of the major performance issues were tackled in the Prisma v5.x.x releases and there is no real reason to not use Prisma in Sep 2023.

    • @nikolasburk
      @nikolasburk Před 7 měsíci +1

      @@arogueotaku Hey there 👋 I'm Nikolas from the Prisma team!
      Prisma ORM indeed is based on engine files that are written in Rust, we have an entire page about this in our docs that explains the architecture. The query engine runs as a side-car process on the server where you deploy your application with Prisma ORM. While I can see how this is a different approach compared to other ORMs, I wouldn't consider it a "flaw" in the architecture. As a developer you won't even notice that the engine files exist, the only situation to be aware of them is sometimes during deployment (e.g. when you deploy to Serverless or Edge, in these cases you can check the deployment guides in our docs).
      I can't follow the claim about "emulating foreign key relations", sorry! Prisma ORM definitely supports foreign keys and uses them by default for any relations in your Prisma schema. When you define a relation in the schema, Prisma Migrate generates a SQL migration file for you (which you can also customize) that defines a FK between the two tables that have the relation in your Prisma schema. Does this help or otherwise can you maybe elaborate on what exactly you heard? Can you maybe also share where you have heard that so that we can correct the record there as well?
      Finally, I would definitely always recommend to try out tools yourself instead of "shying away" from them just because of some claims you have heard on the internet 🙂 Prisma ORM is being used very successfully by a plethora of companies (you can check them out on our /showcase page), it's the default ORM for upcoming web frameworks and dev tools like RedwoodJS (founded by GitHub's co-founder), Amplication (recently raised a $6.6M seed round), Wasp Lang (YC W21), KeystoneJS, create-t3-app, Blitz as well as most the official Remix stacks.
      Hope this helps! If you ever have any questions, don't hesitate to reach out! You can find us on Twitter, GitHub and Discord and we're always happy to help 😄

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

      @@arogueotakuradio silence… 😢

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

      Hey there @@ubitubee 👋I had responded to the comment already but it needed to get approved. It now seems to be visible so you can read my reaction to the claims of @arogueotaku now 🙏

  • @cloudagnostic
    @cloudagnostic Před 7 měsíci +7

    There’s a reason you have 2 million subs! Very informative and top tier tutorial. Thanks Brad!

  • @ricardocnn
    @ricardocnn Před 7 měsíci +9

    Wow man, I'm studying PostgreSQL, it was exactly what I was going to start studying to implement in my apps. Thanks!

  • @ead5590
    @ead5590 Před 7 měsíci +6

    This is amazing! I'd learnedPrisma through their docs about a year ago, which is really easy to follow and I had it hooked to the Planet Scale DB. It worked effortlessly! This tutorial just adds to all of the awesomeness. 😆 Thanks to Brad and Prisma! ✌🏻

  • @shlomominkowicz65
    @shlomominkowicz65 Před 7 měsíci +7

    Hey Brad, Excellent video as always!! Clear, strait to the point. It's like breath of fresh air. On the other note, you mentioned re-doing your Next.js course. When could we expect that :)

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

    Thank you, Brad. Short, concise and informative. The usual high standard we all are enjoying from you. 🤛

  • @matthewclarke1926
    @matthewclarke1926 Před 7 měsíci +8

    ORM was a wishful dream of mine once. Ultimately, it is my opinion that you just need to get good at SQL. The time you spend trying to learn the ORM interface and hacking it to get it to do what you want is better spent learning SQL. 10 years from now your knowledge of a particular ORM interface will be worthless and your SQL knowledge will be valuable. Regardless, thanks for posting. I love your videos.

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

      Have you tried Blazor? The sql can be generated code first (from the models). .Net 8 sounds good.

    • @claude3957
      @claude3957 Před 4 měsíci +1

      This 100% market-dependant. You could have said the same about React ten years ago: “knowing pure JavaScript is more valuable!” But in truth you can’t really know how ubiquitous ORMs will or will not be in the long run.

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

      @@claude3957 React will fall to Vanilla JS.

  • @mehrdara6545
    @mehrdara6545 Před 7 měsíci +3

    Thank you Brad every time I want to learn something new you are my first goto youtube channel

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

    it's so much simple and more straightforward than firebase functions. It's Amazing!

  • @kajalmishra6895
    @kajalmishra6895 Před 7 měsíci +2

    Wow❕ Brad you read my mind. This is exactly what I need for my project.

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

    Thank you Brad! You're carrying my dev journey

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

    Thanks a ton for this. following your videos since 2016, learned a lot from you.

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

    Good job Brad. You add accessibility to new tech and that’s awesome.

  • @r-i-ch
    @r-i-ch Před 7 měsíci +2

    Thanks Brad! I'd love to see this with Drizzle.

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

    Yes! Traversy Media did a Prisma video!
    Thank you!!

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

    Thank you very much for sharing such high-quality educational material. Your lessons are always very clear and straightforward. Thank you 🌻

  • @GilAguilar
    @GilAguilar Před 7 měsíci +1

    Sweet thanks for sharing Brad 🤟💙☕️

  • @aliissa1058
    @aliissa1058 Před 7 měsíci +1

    You are the best! Thank you

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

    Thanks, this video was great and straight to the point! Super effective. I will subscribe and check other videos from you!

  • @SandeepSingh-ye5fh
    @SandeepSingh-ye5fh Před 7 měsíci +1

    Thanks for sharing valuable videos ❤

  • @theophilus494
    @theophilus494 Před 7 měsíci +2

    see boss! you are a blessing.. thanks so much!!!

  • @aburaihan-py4vi
    @aburaihan-py4vi Před 7 měsíci

    Excellent!

  • @user-uy4qp1qx3n
    @user-uy4qp1qx3n Před 4 měsíci

    Awesome!. Thanks for making videos like this. Really enjoy your videos. Please, make more videos like this!.

  • @mahmudbakale8190
    @mahmudbakale8190 Před 7 měsíci +1

    Thank you, so much Brad, you've always been my go to whenever am trying to checkout new stuff in my development journey, but i dont know if can help with a video on Sequilize ORM, thank you once again

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

    Very clear. One observation: at 24:35 we added "articles" to the user Sara, but made it an object, not an array like in the User model? It worked with SQLite. It's possible to add multiple articles with a user.

  • @ronydas5474
    @ronydas5474 Před 7 měsíci +1

    Interesting ❤

  • @alikisang827
    @alikisang827 Před 7 měsíci +3

    You're a hero, I have developed my own company as your own student, much love Brother 🙏. Come to Kenya vacation I will host you ❤❤

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

    thank you its great for getting started

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

    as usual, you are the best!

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

    Spot on.
    Thanks buddy

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

    Great effort, thanks alot

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

    thank you it really helps❤

  • @ar-swe
    @ar-swe Před 7 měsíci

    really awesome love you

  • @Omar-Tood
    @Omar-Tood Před 7 měsíci

    Thanks brad❤

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

    Thanks from Germany!

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

    Thanks for your time sir💯💪

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

    Thanks a lot !
    I have a question about your courses : are the vidéos downloadable if I want for exemple to watch them offline ?
    Thank you in avance for your answer.

  • @feelchi1star
    @feelchi1star Před 7 měsíci +1

    This is really educative.
    Can the models in schema.prisma be split into separate files to enhance code readability? Just mongoose ORM.

  • @Salah-YT
    @Salah-YT Před měsícem +1

    thank u so much 😍👍

  • @umitcelik5508
    @umitcelik5508 Před 7 měsíci +1

    Prisma will save us from sequelize. Finally!

  • @Blacken997
    @Blacken997 Před 7 měsíci +1

    How do you choose between using Prisma and Knex?

  • @arunsuthar4783
    @arunsuthar4783 Před 7 měsíci +3

    We want full next js course with typescript

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

    brad,would you update the rest of javascript from the begining video?please update this video because this video is very helpful in learning javascript

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

    What VScode Theme is that, I really like it, share your setup pls, thanks!

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

    Thanks for the video, you have gained a new subscriber.... What is the possibility of releasing a video with more advanced queries, transactions, etc...
    Greetings Jose Grillo from Venezuela

  • @Lavinvlog
    @Lavinvlog Před 7 měsíci +1

    Please make a tutorial on remix

  • @esdegan7176
    @esdegan7176 Před 7 měsíci +1

    G R A P H C O O L
    V 3

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

    Thanks sir

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

    ❤❤

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

    Hell yes

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

    Thanks

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

    This is amaizing. Can you make one on how to use prisma with Knexjs?

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

    Theres a competitor called: DrizzleORM please take a look as well.

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

    You're so great Brad.❤
    I have an issue when I want to update my tables. The whole database just clears off and resets.
    I am using Supabase, but I use prisma to push migrations. Now I want to update an enum(even though I do this in the database table directly, it doesn't affect the project). So I edited the prisma models.
    How do I add to the enum without actually deleting the database information?

  • @DontFollowZim
    @DontFollowZim Před 7 měsíci +1

    Have you been using it for a while? Have you felt noticeable perf gains after the big update? Have you tried it in an edge runtime environment?

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

    Awesome, now its time for Drizzle 🙃

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

    If possible, develop a crash course on Laravel Blade and some useful UI libraries (not Breeze), sir please 🥺🙏.

  • @melanatedthought7014
    @melanatedthought7014 Před 7 měsíci +1

    I swear to the lord christ, I was looking for a crash course on Prisma...can you do one for dribble

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

    Make a course on iOS development.. 23:38

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

  • @PavanKatepalli-fb4ly
    @PavanKatepalli-fb4ly Před 6 měsíci

    active record is still so much better

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

    Prisma !== Production is true

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

    Hello my friend!
    Why do you forbid access to your site for users from Russia?
    Does any russian offend you?

  • @Franck_Polla
    @Franck_Polla Před 26 dny

    thank you very much