Hey all!
I’m releasing a mini series all about the Relation Column in Glide.
Before I create tutorials on more intermediate topics such as conditional relations, crafting matching values, or navigation and data generation via relations, we need to start from the beginning.
To kickstart the miniseries, here’s a tutorial on the basics of creating relations in Glide.
Wait...what's a Relation in Glide?
In Glide, a Relation is a column type that allows you to connect two sets of data. Typically, relations have a Parent-Child relationship. Just like children belong to their parents, often, certain data in your app “belongs” to another set of data.
In the video below, I use the idea of Topics and Lessons. Lessons belong to a Topic. I want to relate the Topics to their respective Lessons.
To relate (match) two sets of data, there needs to be an identical value in each data set. In the video below, I create and populate a “Topic” column in the Lessons table. Now, I can relate the matching data in the Topics table to the Lessons Table using this identical value.
Taking time to understand how your data tables will relate to one another will make app development infinitely easier.
Enjoy!
Also, if you’re brand new to Glide, make sure to check out the documentation: