Glad to announce Agrest 3.1 release. There are two important things in this release:
1. A big performance improvement. The main change is how we resolve 1..N relationships referenced via "include" keys.
Previously we'd use Cayenne prefetches, and then apply include-level "cayenneExp" and "sort" to those collections in memory. This was both slow (in memory filtering/sorting is much slower than doing it in DB via SQL), and took lots of resources (thousands of objects had to be read from the DB only to be thrown away a moment later).
Now, instead of using Cayenne prefetching, each "included" entity is fetched via its own precise query, with sorting and filtering done via SQL. If you ever used "includes" on to-many relationships, you'll see the difference immediately.
2. Compact hierarchical "include" key.
Agrest consumers (mostly JS programmers) often ran into URL size limitations trying to include every single attribute of related entity by repeating the same include path multiple times. E.g.:
include=id&include=
articles.id&include=articles.title&include=articles.date&include=articles.author
In 3.1 the "advanced" include syntax was amended and is now fully hierarchical, allowing to combine repeating paths and describe the requested tree more succinctly (ideally in a single "include" key) :
include=["id",{"path":"articles","include":["id","title","date","author"]}]
(wish we could also drop JSON-mandated quotes... Things would've looked even better).
Also 3.1 is already integrated in Bootique.
Full release notes:
* #358 Protocol Enhancement: 'include\exclude' parameters should take an array of values
* #384 Change "include" processing strategy from Cayenne prefetches to individual queries
* #392 Request include/exclude settings are ignored for dynamic request properties
* #394 Upgrade Jackson to 2.9.8
* #402 An Included relation is missed in case of update operation
Enjoy!
Andrus