Signed-off-by: Sean Corfield <sean@corfield.org>
This commit is contained in:
Sean Corfield 2024-01-14 17:09:46 -08:00
parent d64177bde5
commit 52ed86284a
No known key found for this signature in database
3 changed files with 4 additions and 4 deletions

View file

@ -6,6 +6,7 @@
* Fix [#518](https://github.com/seancorfield/honeysql/issues/518) by moving temporal clause before alias. * Fix [#518](https://github.com/seancorfield/honeysql/issues/518) by moving temporal clause before alias.
* Address [#495](https://github.com/seancorfield/honeysql/issues/495) by adding (experimental) `format&` and `formatv` macros (`.clj` only!) -- purely for discussion: may be removed in a subsequent release! * Address [#495](https://github.com/seancorfield/honeysql/issues/495) by adding (experimental) `format&` and `formatv` macros (`.clj` only!) -- purely for discussion: may be removed in a subsequent release!
* Implemented `CREATE INDEX` [#348](https://github.com/seancorfield/honeysql/issues/348) via PR [#517](https://github.com/seancorfield/honeysql/pull/517) [@dancek](https://github.com/dancek). * Implemented `CREATE INDEX` [#348](https://github.com/seancorfield/honeysql/issues/348) via PR [#517](https://github.com/seancorfield/honeysql/pull/517) [@dancek](https://github.com/dancek).
* Code cleanup per `clj-kondo`.
* 2.5.1103 -- 2023-12-03 * 2.5.1103 -- 2023-12-03
* Address [#515](https://github.com/seancorfield/honeysql/issues/515) by: * Address [#515](https://github.com/seancorfield/honeysql/issues/515) by:

View file

@ -2392,7 +2392,7 @@
(sql/register-op! :<=> :ignore-nil true) (sql/register-op! :<=> :ignore-nil true)
;; and then use the new operator: ;; and then use the new operator:
(sql/format {:select [:*], :from [:table], :where [:<=> nil :x 42]}) (sql/format {:select [:*], :from [:table], :where [:<=> nil :x 42]})
(sql/register-fn! :foo (fn [f args] ["FOO(?)" (first args)])) (sql/register-fn! :foo (fn [_ args] ["FOO(?)" (first args)]))
(sql/format {:select [:*], :from [:table], :where [:foo 1 2 3]}) (sql/format {:select [:*], :from [:table], :where [:foo 1 2 3]})
(defn- foo-formatter [f [x]] (defn- foo-formatter [f [x]]
(let [[sql & params] (sql/format-expr x)] (let [[sql & params] (sql/format-expr x)]
@ -2404,7 +2404,7 @@
(sql/format '{select * from table where (foo (+ a 1))}) (sql/format '{select * from table where (foo (+ a 1))})
(let [v 42] (let [v 42]
(sql/formatf '{select * from table where (foo (+ a ?1))} v)) (sql/formatf '{select * from table where (foo (+ a ?1))} v))
(let [v 42] (let [v 42] (println v)
(sql/format& '{select * from table where (foo (+ a v))})) (sql/format& '{select * from table where (foo (+ a v))}))
(let [v 42] (let [v 42]
(sql/formatv [v] '{select * from table where (foo (+ a v))})) (sql/formatv [v] '{select * from table where (foo (+ a v))}))

View file

@ -1181,9 +1181,8 @@
:nest :raw)))))) :nest :raw))))))
(comment (comment
(require '[honey.sql :refer [format]])
(-> (delete-from :table) (-> (delete-from :table)
(where [:in (composite :first :second) (where [:in (composite :first :second)
[(composite 1 2) (composite 2 1)]]) [(composite 1 2) (composite 2 1)]])
(format)) (h/format))
) )