codeigniter-base-model
codeigniter-base-model copied to clipboard
Feature/eager relations
Currently if you have to pull n records with a relation to some other object that would result in n+1 queries to the database. With eager loading of relations you would have a constant number of 2 queries being run. I would appreciate it if somebody can take a look at the tests, because most of my time was not spent on the feature but producing the tests. I would constantly have method not found errors on "where_in" even when I mocked it (seemingly) properly and used it on the next line to test it if it's mocked ok. So I'm kinda nervous that I botched the tests somehow. I tried to make sure they test the proper things, but with this "where_in" error driving me mad I could finish producing the test ensuring only 1 query is run on the relation even when no results are being returned by it.
This would be amazing to have! Does this handle nested relations?
Ex. Client
has many Posts
has many Comments