I tried to do something similar with <a href="https://github.com/justinvanwinkle/Norm" rel="nofollow">https://github.com/justinvanwinkle/Norm</a> about 10 years ago. It hasn't generated a lot of interest, but I find it quite useful to construct queries without having to learn the minutia of an ORM library, or even a SQL generation library.<p>Probably one of the best parts of Norm, and a big part of why I wrote it, is that it doesn't require you to have a hardcoded copy of the databases schema in your code, it just works like SQL.<p>I put quite a bit of effort into making bulk inserts efficient, as well as making sure rows could be streamed from the database while buffering as few as possible in memory on the client.<p>I still maintain and update for my own use. Feel free to make suggestions or request features.