I&#x27;d be interested to understand how Korma solves their problem.  It&#x27;s macro-based so I wouldn&#x27;t think it would be particularly good at dynamically restructuring queries based on runtime variables.