For the most part Korma provides a nice composable set of functions for building SQL queries. It gets tricky with where clauses, however, as unfortunately it’s implemented as a macro. One way to work around this yourself though is:

(:require [korma.sql.engine :as eng])
 
(defn where-clause [query form]
  (eng/bind-query
    query
    (eng/pred-map
      (eval
        (eng/parse-where form)))))

Then add it in when needed:

(:require [korma.core :refer [where*]])
 
(let [form '(or {:name "foo"} {:age [> 18]})
      clause (where-clause query form)]
  (where* query clause))

If you don’t mind eval you can make it quite a bit shorter:

(defn where [query form]
  (eval `(korma.core/where ~query ~form)))

You need to build the where forms yourself, but you now have all the tools required.