Prisma Crash Course
ฝัง
- เผยแพร่เมื่อ 26 มิ.ย. 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 - วิทยาศาสตร์และเทคโนโลยี
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! ❤
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?
@@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.
@@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 😄
@@arogueotakuradio silence… 😢
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 🙏
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! ✌🏻
There’s a reason you have 2 million subs! Very informative and top tier tutorial. Thanks Brad!
you damn right!
Thank you, Brad. Short, concise and informative. The usual high standard we all are enjoying from you. 🤛
Wow man, I'm studying PostgreSQL, it was exactly what I was going to start studying to implement in my apps. Thanks!
Thank you Brad every time I want to learn something new you are my first goto youtube channel
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 :)
Thank you Brad! You're carrying my dev journey
it's so much simple and more straightforward than firebase functions. It's Amazing!
Wow❕ Brad you read my mind. This is exactly what I need for my project.
Thanks a ton for this. following your videos since 2016, learned a lot from you.
Good job Brad. You add accessibility to new tech and that’s awesome.
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.
Have you tried Blazor? The sql can be generated code first (from the models). .Net 8 sounds good.
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.
@@claudespeed13579 React will fall to Vanilla JS.
Yes! Traversy Media did a Prisma video!
Thank you!!
Thank you very much for sharing such high-quality educational material. Your lessons are always very clear and straightforward. Thank you 🌻
as usual, you are the best!
see boss! you are a blessing.. thanks so much!!!
Sweet thanks for sharing Brad 🤟💙☕️
Thanks, this video was great and straight to the point! Super effective. I will subscribe and check other videos from you!
Thanks Brad! I'd love to see this with Drizzle.
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.
You are the best! Thank you
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
Thanks for sharing valuable videos ❤
thank you its great for getting started
Thanks from Germany!
Spot on.
Thanks buddy
Great effort, thanks alot
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 ❤❤
Can you employ me in your company 😁, I'm also Kenyan
Hindi sayo hindi akin KENYA
Thanks for your time sir💯💪
thank u so much 😍👍
thank you it really helps❤
Excellent!
really awesome love you
Interesting ❤
Thanks brad❤
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.
thank you so much
This is really educative.
Can the models in schema.prisma be split into separate files to enhance code readability? Just mongoose ORM.
Prisma will save us from sequelize. Finally!
This is amaizing. Can you make one on how to use prisma with Knexjs?
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?
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
How do you choose between using Prisma and Knex?
Thanks
Thanks sir
What VScode Theme is that, I really like it, share your setup pls, thanks!
I may have missed it but this didn't show how you might use it in a project. Do I just need the includes at the top of any file I'm doing database actions in? Do I need to make a function call for each query as I need it of should I be dragging in all the data I need at the top of the file? I mean prisma looks great but I still can't use it..
We want full next js course with typescript
Yes please with mongodb
Yes please!! with postgres
Hell yes
Please make a tutorial on remix
G R A P H C O O L
V 3
❤❤
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?
Theres a competitor called: DrizzleORM please take a look as well.
Awesome, now its time for Drizzle 🙃
Prisma !== Production is true
Make a course on iOS development.. 23:38
If possible, develop a crash course on Laravel Blade and some useful UI libraries (not Breeze), sir please 🥺🙏.
@@memberwhen22 Thanks sir 🙏👍
I swear to the lord christ, I was looking for a crash course on Prisma...can you do one for dribble
Most you swear 😅😅😅
Jesus be like: wtf, when did this happen
active record is still so much better
Hello my friend!
Why do you forbid access to your site for users from Russia?
Does any russian offend you?
thank you very much