Fix the union clause

The previous version omits the UNION between the base query and the
first of the union queries
This commit is contained in:
Donald Ball 2015-08-22 21:24:49 -04:00
parent 7001826d4b
commit fbcd6fbdce
2 changed files with 4 additions and 2 deletions

View file

@ -1,5 +1,7 @@
## 0.6.2 In development
* Fix union clause (@dball)
## 0.6.1
* Define parameterizable protocol on nil (@dball)

View file

@ -519,7 +519,7 @@
(str "WITH RECURSIVE " (comma-join (map cte->sql ctes))))
(defmethod format-clause :union [[_ maps] _]
(string/join " UNION " (map to-sql maps)))
(str "UNION " (string/join " UNION " (map to-sql maps))))
(defmethod format-clause :union-all [[_ maps] _]
(string/join " UNION ALL " (map to-sql maps)))
(str "UNION ALL " (string/join " UNION ALL " (map to-sql maps))))