Drizzle ORM #5- One To One Relation ⭐

  Рет қаралды 7,097

Sakura Dev

Sakura Dev

Күн бұрын

❤️Please Support me by subscribing to my channel 👉🏻www.youtube.co...
In this episode of Drizzle ORM Comprehensive Course, You will learn about how to create One-To-One Relations with Drizzle ORM.
📖 Drizzle ORM Playlist: • Drizzle ORM Comprehens...
🎞️ Drizzle ORM: #1- Setup Postgres | Schema | Migrations: • Drizzle ORM #1- Setup ...
🎞️ Drizzle ORM: #2- SQL Data Types: • Drizzle ORM #2- SQL Ty...
🎞️ Drizzle ORM: # 3- Writing The First Query: • Drizzle ORM #3- Write ...
🎞️ Drizzle ORM #4- All Query Filters : • Drizzle ORM #4- All Qu...
🎞️ Drizzle ORM #5- One To One Relation : • Drizzle ORM #5- One To...
🎞️ Drizzle ORM #6- One To Many Relation : • Drizzle ORM #6- One To...
🎞️ Drizzle ORM #7: • Drizzle ORM #7- Many-T...
--------------------------------------------------
🚀 GitHub Repo (Don't Forget to Give a ⭐): github.com/vah...
💖 My Twitter for more insights: / sakura_dev_web
--------------------------------------------------
Other videos you might like:
Type Safety and Auto Completion for ENV Variables in NextJS: • Type Safety For ENV Va...
#DrizzleOrm #Orm #nodejs #nextjs #typescript

Пікірлер: 27
@kristemmerman921
@kristemmerman921 11 ай бұрын
You helped me fix my relationships in my schema, thank you!
@mathiasriissorensen6994
@mathiasriissorensen6994 8 ай бұрын
I don't know why but I keep getting "Error: Cannot read properties of undefined (reading 'referencedTable')" when I add the "with" followed by my defined relation.
@HelcioFranco
@HelcioFranco 5 ай бұрын
This helped a lot, I missed to export my "relations" object Thank you very much
@wavyboyjodii
@wavyboyjodii 9 ай бұрын
appreciate u sir
@Ayush-cn7tq
@Ayush-cn7tq Жыл бұрын
This video is soo great i just can not explain
@SakuraDev
@SakuraDev Жыл бұрын
OMG! Thank you so much! Your nice comment really encourages me to add more episodes to the Drizzle ORM Playlist.
@Ayush-cn7tq
@Ayush-cn7tq Жыл бұрын
@@SakuraDev I just can't tell you bro , I was reading docs and I just couldn't get it how relations worked you came as a life saver , by the way are u Indian and can I connect with u
@SakuraDev
@SakuraDev Жыл бұрын
@@Ayush-cn7tq Thanks a lot for kind words. I am not indian But I really like indians and I do respect them. You are really nice people 👋😃
@somecompany3506
@somecompany3506 11 ай бұрын
Great tutorial 👍
@SakuraDev
@SakuraDev 11 ай бұрын
Thanks 🙏👍
@bangunny
@bangunny 7 ай бұрын
should i wrap the query function inside a try catch ?
@Andrew-tl9gk
@Andrew-tl9gk 9 ай бұрын
Thanks, very well explained! Just a follow up question: When I want to query the other way around "get profile with user" I need to add another foreign key to `users` and another relations?
@JeremyKennedy11
@JeremyKennedy11 8 ай бұрын
You just gotta add the foreign key to the profile, as explained in the video, but as well, define the relations for both users AND profile. My variable names differ sligntly but basically you just need both of these blocks (one is already written in the video): export const UserTableRelations = relations(UserTable, ({ one }) => ({ profile: one(ProfileTable, { fields: [UserTable.id], references: [ProfileTable.userId], }), })); export const ProfileTableRelations = relations(ProfileTable, ({ one }) => ({ user: one(UserTable, { fields: [ProfileTable.userId], references: [UserTable.id], }), }));
@mehmethanifierenler3612
@mehmethanifierenler3612 6 ай бұрын
thanks
@SakuraDev
@SakuraDev 6 ай бұрын
You're welcome!
@JonathanAvison
@JonathanAvison 10 ай бұрын
Thanks so much ! I would like to get the users.id and the users.name in the profiles! So when i fetch profiles i can show the name of the user and not the id! How can i do that ?
@prashlovessamosa
@prashlovessamosa Жыл бұрын
Thanks for sharing.
@SakuraDev
@SakuraDev Жыл бұрын
Thanks, I hope it was helpful
@gamingwolf3385
@gamingwolf3385 6 ай бұрын
100th like 💪😁
@SakuraDev
@SakuraDev 6 ай бұрын
Thanks 👍
@PrashantRajput-c3b
@PrashantRajput-c3b 4 ай бұрын
I want to implement send and accept friend request option should i create one to one relation or one to many relation?
@SakuraDev
@SakuraDev 4 ай бұрын
It should be many to many
@PrashantRajput-c3b
@PrashantRajput-c3b 4 ай бұрын
@@SakuraDev ok thankYou so much
@SakuraDev
@SakuraDev 4 ай бұрын
@@PrashantRajput-c3b thanks 🙏 hope that helps you
@_codesan
@_codesan Жыл бұрын
please create video about that seeding 😢
@_codesan
@_codesan Жыл бұрын
thank you btw, your video help me so much
@SakuraDev
@SakuraDev Жыл бұрын
Ok, next week will be uploaded.
Drizzle ORM #6- One To Many Relation ⭐
10:25
Sakura Dev
Рет қаралды 10 М.
Крутой фокус + секрет! #shorts
00:10
Роман Magic
Рет қаралды 14 МЛН
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 196 М.
tRPC + NextJS App Router = Simple Typesafe APIs
19:18
Jack Herrington
Рет қаралды 80 М.
What’s Up with Laravel? It’s Everywhere, and Here’s Why!
6:22
DONT USE AN ORM | Prime Reacts
25:46
ThePrimeTime
Рет қаралды 229 М.
One-to-One Relationships - The Whiteboard #11
12:17
SQLBI
Рет қаралды 8 М.
Microservices with Databases can be challenging...
20:52
Software Developer Diaries
Рет қаралды 41 М.
Easiest Database Setup in Next.js 14 with Turso & Drizzle
38:09
Sam Meech-Ward
Рет қаралды 19 М.