I can not understand what problem this library solves ? Why to write SQL in Clojure and translate it back to SQL ? Examples on website are quite simplistic. They are far away from real life SQL queries that usually bigger and more complex (not select and join couple of tables). What about "group by", joining 5 or 8 tables etc.? How you are supposed to prototype and test your queries on existing schema (there are many…
Clojure code is Clojure data. So, these SQL statements are really just nested lists. Instead of writing an ad-hoc SQL parser and doing string manipulation, you can write relatively simple Clojure functions to manipulate these lists and generate valid SQL.
2. They are not simple functions. Compare this : (-> (select (table {} {:employees :p})(where (= :name "John")))(join (table {} {:employees :b})(where (= :p.manager :b.id)))to-sql)
to this :
SELECT p.,b. FROM employees p JOIN employees b ON (p.manager = b.id) WHERE (name = 'John')
Which one is more verbose ?
EDIT: SQL examples with "employees" and "departmets" are very misleading and usually oversimplify the reality.