Merge branch 'master' of github.com:jkk/honeysql
This commit is contained in:
commit
c190acf282
2 changed files with 18 additions and 2 deletions
|
|
@ -3,7 +3,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.
|
* Alias expressions `[:col :alias]` are now checked to have exactly two elements. Fix #226.
|
||||||
* Allow `where` and `merge-where` to be given no predicates. Fix #228.
|
* Allow `where` and `merge-where` to be given no predicates. Fix #228 and PR #230.
|
||||||
|
|
||||||
## 0.9.3
|
## 0.9.3
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
[honeysql.helpers :refer [select modifiers from join left-join
|
[honeysql.helpers :refer [select modifiers from join left-join
|
||||||
right-join full-join where group having
|
right-join full-join where group having
|
||||||
order-by limit offset values columns
|
order-by limit offset values columns
|
||||||
insert-into with]]
|
insert-into with merge-where]]
|
||||||
honeysql.format-test))
|
honeysql.format-test))
|
||||||
|
|
||||||
;; TODO: more tests
|
;; TODO: more tests
|
||||||
|
|
@ -215,4 +215,20 @@
|
||||||
(where [:= :id (sql/inline nil)])
|
(where [:= :id (sql/inline nil)])
|
||||||
sql/format))))
|
sql/format))))
|
||||||
|
|
||||||
|
(deftest merge-where-no-params-test
|
||||||
|
(testing "merge-where called with just the map as parameter - see #228"
|
||||||
|
(let [sqlmap (-> (select :*)
|
||||||
|
(from :table)
|
||||||
|
(where [:= :foo :bar]))]
|
||||||
|
(is (= ["SELECT * FROM table WHERE foo = bar"]
|
||||||
|
(sql/format (apply merge-where sqlmap [])))))))
|
||||||
|
|
||||||
|
(deftest merge-where-test
|
||||||
|
(is (= ["SELECT * FROM table WHERE (foo = bar AND quuz = xyzzy)"]
|
||||||
|
(-> (select :*)
|
||||||
|
(from :table)
|
||||||
|
(where [:= :foo :bar])
|
||||||
|
(merge-where [:= :quuz :xyzzy])
|
||||||
|
sql/format))))
|
||||||
|
|
||||||
#?(:cljs (cljs.test/run-all-tests))
|
#?(:cljs (cljs.test/run-all-tests))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue