Just to be sure: Have you read my response to Luke, and have you thought about using RESTXQ and providing a single entry point (for the beginning) for queries that calls xquery:eval?
Yes, I have seen the response. Using the single restxq entry point and xquery:eval is one of the more likely solutions for us.
You can also store your queries in the filesystem of your server. And you could add other endpoints to store and update your custom database queries.
Not entirely sure what you are suggesting here.
I understand that there are multiple methods we could employ to direct our applications to execute the correct queries, with varying levels of effort and varying returns on cleanliness and ease of use. I would suggest that extending the current module repository system would be a more natural approach, and would bring in some concepts that have parallels in other database applications. Granted this might be a large amount of effort, so I would be expecting this to be a feature request.
For now, we will likely go with whichever is the simplest for us to achieve
Chris