Learn Prisma Relationships (1-1, 1-m, m-m)

preview_player
Показать описание
Prisma makes managing complicated relationships simple. By watching this video you will learn how to model and work with the most common relationships you will be creating in your applications.

0:00 Intro
1:28 One-to-one
9:09 One-to-many
16:01 Many-to-many
21:05 Many-to-many self reference

🌎 Follow me here:
Рекомендации по теме
Комментарии
Автор

A bright side of being a night lurker on Brazil: having the opportunity to watch awesome tutorials on Aussie afternoon. Superb tutorial again Tom. 👌🏼

ThiagoVieira
Автор

Thanks for the video! It was just a bit too fast but I'll analyze it with more time

pablom
Автор

I notice you do a lot of dev migrations (around 26:00). I'd recommend using prisma db push to apply changes to the database while in dev and only creating a migration once satisfied everything works as intended. This keeps the migrations history leaner, as it only has major schema changes, no minor ones. Think of it in git terms, you make a lot of commits as you work, then you push or merge once those changes are finalized.

Note: I know this is done for demonstration purposes, it's just a tip for viewers.

gosnooky
Автор

You do incredible work! Love you stuff, especially the more advanced stuff

snivels
Автор

Thank you so much.... Verymuch I really mean it... Thank you very much

ststandardcbse
Автор

@TomDoesTech What is the VSCode extension you are using that is giving your Prisma Syntax Suggestion? That's really cool bro

muhammadashfaq
Автор

The many-to-many relation at 13:01 between product and Category doesn't make sense.
The one that is defined is one-to-many, not many-to-many
I am assuming you will change that later on in the video.

abdullah-ayy
Автор

waooo I really liked your video, will you have any video using prism where you compare tables or products ... example I have several stores that sell the same products that can compare the prices of those products and organize them in order from cheapest to most expensive ... examples in that style ...??

or you could guide me how to do it ... greetings Jose Grillo of Venezuela

Grishopping
Автор

Thank you very much for your effort, Does Prisma has model inheritance like BaseEntity implementation, if it has, how can we make it with Postgres, if not, is there any promise in the future to make it in Prisma?

muhammedubeyd
Автор

let's suppose we have a user table and multiple profile tables (CustomerProfile, Admin profile)

in this case different profiles tables have one relation userID.

How are you going to tackle the User table ?
do we need to add multiple fields in users table like CustomerProfile?, AdminProfile

dearvivekkumar
Автор

@19.29, you're mapping your product category to a random category that was already made in the first transaction. If you were seeding a database with an array of users with an array of tasks, do you know how you'd map a the first element of the items array to the first user in the user array? ie. userid: task[task.map((i, index) => getting Type 'number[]' cannot be used as an index type.ts(2538).

allisfehr
Автор

great tutorial, next time deactivate the autocomplete?

changNoi
Автор

Very poor explanation, designed for trained users who have already worked with Prisma.

SergiyAntonyuk_PhD
Автор

what are you teaching man? you're not explaining anything. nobody is here to see you coding, we are here to understand stuffs.

musa.ibrahim.