jgaskins/perpetuity

JOIN queries

Opened this issue · 0 comments

All the major SQL and a few NoSQL databases support JOIN queries. Currently, there is nothing in here to support them. Everything is queried like we're doing an ActiveRecord includes to load associated records, but I'd like to support joins:

article_mapper = Perpetuity[Article]
article_mapper.select { |article| article.author.name == 'Jamie' }

The mapper would then look at the author attribute, see that it's a reference to another object, then set up that join. And along with #44, we need a way to indicate that in the intermediate query form.