It would cover a lot of custom embedding cases if we were able to make an API call and pass in just any SQL, and get JSON results back.
One good use-case is integrating with WordPress.
First, install a plugin that fetches JSON and provides a simple templating language to render the JSON data the way you need:
Next, let the plugin make an API call and pass an SQL query IN and gett a JSON result OUT. This would allow to extract whatever data you need directly from the database.
Now, to get it even further, a simple SQL API section in the settings might be helpful. It would allow us to create custom SQL queries and assign names to them. Then through API we could just use the SQL name instead of passing the whole sql:
Fairly, the implementation does not sound as difficult from the programming point of view.
Anyone interested? Should be a plugin or part of core functionality?