Fix #226 by adding assert
This commit is contained in:
parent
c25f8c73da
commit
284d0142b6
2 changed files with 11 additions and 8 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
* `#sql/inline nil` should produce `NULL`. Fix #221. (@seancorfield)
|
||||
* `#sql/inline :kw` should produce `"kw"`. Fix #224 via PR #225. (@vincent-dm) Note: this introduces a new protocol, `Inlinable`, which controls inline value rendering, and changes the behavior of `#sql/inline :foo/bar` to produce just `"bar"` (where it was probably invalid SQL before).
|
||||
* Alias expressions `[:col :alias]` are now checked to have exactly two elements. Fix #226.
|
||||
|
||||
## 0.9.3
|
||||
|
||||
|
|
|
|||
|
|
@ -349,14 +349,16 @@
|
|||
(paren-wrap (comma-join (map to-sql x)))
|
||||
:else
|
||||
;; alias
|
||||
(str (to-sql (first x))
|
||||
; Omit AS in FROM, JOIN, etc. - Oracle doesn't allow it
|
||||
(if (= :select *clause*)
|
||||
" AS "
|
||||
" ")
|
||||
(if (string? (second x))
|
||||
(quote-identifier (second x))
|
||||
(to-sql (second x))))))
|
||||
(do
|
||||
(assert (= 2 (count x)) (str "Alias should have two parts" x))
|
||||
(str (to-sql (first x))
|
||||
; Omit AS in FROM, JOIN, etc. - Oracle doesn't allow it
|
||||
(if (= :select *clause*)
|
||||
" AS "
|
||||
" ")
|
||||
(if (string? (second x))
|
||||
(quote-identifier (second x))
|
||||
(to-sql (second x)))))))
|
||||
|
||||
(extend-protocol types/Inlinable
|
||||
#?(:clj clojure.lang.Keyword
|
||||
|
|
|
|||
Loading…
Reference in a new issue