You mention about making it available to customers - are you looking for APIs ?
https://github.com/o1lab/xmysql - one command to generate rest api for any mysql database in seconds. (shameless plug - something i've been workng on)
This supports grouping, count and where as query params of api. I'll be happy to help - pls raise an issue if you get stuck. Thank you.