I would like to give Query some logical grounding, so we can guarantee particular types of behavior.
The model that make sense for this is to develop a small algebra. This algebra won't actually be a relational algebra for a couple reasons. First, DataMapper's primary goal isn't to adhere directly to relational algebra because there are supported query engines which are not capable of doing so. Second query objects themselves aren't actually representations of joins. They're representations of criteria on a dataset. It may be the case that the dataset being queried is the result of an additional join operation, if the data engine being queried is capable of satisfying such a join object.
- Repository
- Model
- Fields
- Conditions