I'm using the [clojureql "1.0.0"] library.
(:require [clojureql.core :as sq])

The following query doesn't generate correct sql:

(-> (sq/select (sq/join (sq/table db :tableA)(sq/table db :tableB)(sq/
where (= :tableA.id 27219)))
(sq/where (= :tableA.group_id 27202)))
(sq/union (sq/select (sq/join (sq/table db :tableA)(sq/table
db :tableB)(sq/where (= :tableA.id 27391)))
(sq/where (= :tableA.group_id 27353))) :all))

The sql that it generates:
(SELECT tableA.,tableB. FROM tableA JOIN tableB ON (tableA.id = 27219)
WHERE (tableA.group_id = 27202)) UNION ALL (SELECT tableA.,tableB.
FROM tableA JOIN tableB ON (tableA.id = 27391) WHERE (tableA.group_id
= ?))

The sql that should generate:
(SELECT tableA.,tableB. FROM tableA JOIN tableB ON (tableA.id = 27219)
WHERE (tableA.group_id = 27202)) UNION ALL (SELECT tableA.,tableB.
FROM tableA JOIN tableB ON (tableA.id = 27391) WHERE (tableA.group_id
= 27353))

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to