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 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).
|
* `#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
|
## 0.9.3
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -349,14 +349,16 @@
|
||||||
(paren-wrap (comma-join (map to-sql x)))
|
(paren-wrap (comma-join (map to-sql x)))
|
||||||
:else
|
:else
|
||||||
;; alias
|
;; alias
|
||||||
(str (to-sql (first x))
|
(do
|
||||||
; Omit AS in FROM, JOIN, etc. - Oracle doesn't allow it
|
(assert (= 2 (count x)) (str "Alias should have two parts" x))
|
||||||
(if (= :select *clause*)
|
(str (to-sql (first x))
|
||||||
" AS "
|
; Omit AS in FROM, JOIN, etc. - Oracle doesn't allow it
|
||||||
" ")
|
(if (= :select *clause*)
|
||||||
(if (string? (second x))
|
" AS "
|
||||||
(quote-identifier (second x))
|
" ")
|
||||||
(to-sql (second x))))))
|
(if (string? (second x))
|
||||||
|
(quote-identifier (second x))
|
||||||
|
(to-sql (second x)))))))
|
||||||
|
|
||||||
(extend-protocol types/Inlinable
|
(extend-protocol types/Inlinable
|
||||||
#?(:clj clojure.lang.Keyword
|
#?(:clj clojure.lang.Keyword
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue