Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Proof of concept on admin query interface #2120
In the Admin API Design we defined a black box of a query builder. The reason being, admin queries need to be more flexible, but more consistent between models. Opposed to the current query patterns, where queries are written one off and don't follow a pattern across handlers.
This is the first take at defining what that query interface can be.
It uses reflection on the models and takes advantage of the
The general idea is that we can pass any model with a set of filters to a set of functions. Not only does this provide us with consistent query interface, it is also the first step to hiding pop from our services and handlers. The query builder would become the dependency rather than the db connection.
This is a bit experimental, not set in stone, and I would love some feedback.
Right now this isn't hooked up to a handler, so running the service tests is the best way to check it out.
Code Review Verification Steps
requested review from
May 10, 2019
macrael left a comment
I am very pleased with this move towards wrapping Pop in an interface that we define and control. I think that implementing this across some more services will be very illuminating and will help define exactly what the right interface should be. A couple use cases I'm curious about:
I think that the interface work is very nicely done, it makes good sense how the three different layers work together.
@@ Coverage Diff @@ ## master #2120 +/- ## ========================================== + Coverage 58.67% 58.98% +0.31% ========================================== Files 245 250 +5 Lines 13960 14077 +117 ========================================== + Hits 8191 8303 +112 - Misses 4767 4773 +6 + Partials 1002 1001 -1