In any reasonably realistic data model, there are bound to be multiple entities needed to completely describe your business domain. And when there are multiple entities involved, they would be related to each other in some way. Hence, we need a way to describe relationships between entities.
Databases have their own way of establishing relationships between tables using foreign keys and then using joins to connect two or more tables. However, ORMs also need to provide a way to describe these entity relations in a programmatic way.
TypeORM is no different.
It provides a bunch of decorators using which we can declare various relations such as One-to-One, One-to-Many and Many-to-Many relationships.
00:00 - Intro to TypeORM Relations
01:20 - TypeORM One to One Relation
03:38 - TypeORM One to Many Relation
05:16 - TypeORM Many to Many Relation
#TypeORM #Typescript #TypeORMRelations
++++++++++++++++++++++++++++++++++++++++++++++++
Visit my General Tech Blog for lots of how-to articles on various technologies:
http://www.progressivecoder.com
Visit my Web Development Specific Tech Blog if you are interested only about web development:
https://www.progressivewebninja.com
You can also check out my Github account for examples I have built:
https://www.github.com/dashsaurabh
+++++++++++++++++++++++++++++++++++++++++++++++++