Back

is it possible to have a relationship but to get get it on demand?

  • 0
  • Databases
  • Web
  • Cloud
ThisIsStep2
1 Jul, 2024, 14:15

i'm about to have many models, related to each other, and in most cases, i wouldn't like to get the whole tree... the whole model with it's relations, and relations of relations.... Is it possible?

TL;DR
Developers are wondering if it's possible to have relationships in a database but only fetch them on demand. One suggestion is to save the related item ID in a column and perform the join manually when needed. This way, you can select everything except the related item. This approach can help avoid fetching the entire tree of related models and their relations.
Kenny
1 Jul, 2024, 14:55

You can use the select query to select everything but the related item

Kenny
1 Jul, 2024, 14:56

but right now relationships are pretty inefficient, so you may be better or saving the related item ID in a column and doing the join yourself when fetching the data

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more