A custom query allows creating dynamic criteria, like dynamic query API. In many situations, this avoids the need to create a custom query completely. However, in some cases, a custom query, called custom-sql, could be useful. For instance, there is a complex JOIN query and it is hard to do in the dynamic query API. In this case, custom query would be very helpful.
Let's consider a real example. A query says "find me all the articles with a specific
groupId, subscribed to by a specific user, ordered by
createDate". Of course, you could use the dynamic query API. Here, we are using this request as an example to show how to build a custom query in the Plugins SDK.
In general, you should be able to build a custom query in ...