ibdknox/Korma — pull request #58 by RingMan (2012-04-28 16:42:50+00:00)
Title: Parenthesize multiple JOIN expressions

Microsoft Access complains about syntax errors when using
multiple joins. The solution seems to be wrapping nested
joins in parentheses.

Example:

(use '[korma config core])
(defentity users)
(defentity emails)
(defentity phones)
(set-delimiters "[" "]")
(def q (-> (select* users)
(join emails (= :users.email :email.addr))
(join phones (= :users.phone :phone.num))))
(sql-only (select q))

SELECT [users].*
FROM ([users] LEFT JOIN [emails] ON [users].[email] = [email].[addr])
LEFT JOIN [phones] ON [users].[phone] = [phone].[num]