Hello,

It's clearly a bit more than a proposal since I've already coded a prototype, but the idea is there: an EDSL for SQL: https://github.com/momomimachli/Hedsql/wiki

Nevertheless, there’s still much to do to have something really complete. Before coding what’s missing (such as pretty print), I’d be very glad to receive some feedback. I’ve now reached a design point where I’m a bit lost and wondering if I’ve made the right choices and what could be improved. Any comments would thus be greatly appreciated. Thank you in advance for your help :-)

A description of the code organization is here: https://github.com/momomimachli/Hedsql/wiki/Structure

The source code here: https://github.com/momomimachli/Hedsql

And many examples here: https://github.com/momomimachli/Hedsql-tests

Here are some main questions (but of course comments on other matters are welcomed!):

AST (Database/Hedsql/Common/AST.hs)