Difference between repositories and relations

I can see some confusion here. No repo is not tied to any relation. The reason why “root repositories” were introduced is because it’s very, very common, to use a single relation as “the starting point” from which you get the data. That’s why it was beneficial to create a simple abstraction for such use case.

Repositories have access to all relations. The fact you typically use a single one as your “root” in aggregates is the reason why we have root repos. This allows you to do things like use root method in abstract way to add additional functionality (like “default scope” etc.).

I will try to explain this better in the docs. Thanks for feedback :heart:

2 Likes