&gt; and somehow programmatically assemble a query out of the pieces.<p>You can do this today, in various statically typed languages[1] (perhaps dynamic languages as well, though the composition will likely be more ad hoc).<p>Agreed re: under the hood complexity, but that&#x27;s more in supporting multiple database engines (and related corner cases) than the transformation of Query &gt; AST &gt; SQL.<p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10525040" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10525040</a>