Looks similar to sequelize http://docs.sequelizejs.com/en/latest/
This kind of things looks better in homoiconic languages.
I'm wondering how that approach compares to rho/rewriting calculus.
Our use case for Queryl is to filter array of objects based on different criteria, but I guess an extra benefit is that the query language is completely decoupled from its usage, so anyone can use it in their own projects for different needs.