Additional work on #325; update CHANGELOG
This commit is contained in:
parent
e38bb73295
commit
819c6e7c19
2 changed files with 10 additions and 6 deletions
|
|
@ -1,9 +1,10 @@
|
||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
* 2.0.next in progress
|
* 2.0.next in progress
|
||||||
* Update `test-runner`.
|
* Address #326 by allowing `ON`/`USING` to be optional and not dropping parameters on the floor. _[still needs tests to be written!]_
|
||||||
|
* Fix #325 by making the `%` function call syntax respect `:quoted true` and/or `:dialect` options, and also allowing for qualified column names _[some additional tests needed plus likely documentation updates]_. (PR from @lognush)
|
||||||
* Add `:quoted-snake true` option to force conversion from kebab-case to snake_case when `:quoted true` or a `:dialect` is specified to `format`.
|
* Add `:quoted-snake true` option to force conversion from kebab-case to snake_case when `:quoted true` or a `:dialect` is specified to `format`.
|
||||||
* TBD `%` function syntax may respect `:quoted true` or a `:dialect` is specified to `format` (awaiting PR).
|
* Update `test-runner`.
|
||||||
|
|
||||||
* 2.0.0-rc1 (for testing; 2021-05-06)
|
* 2.0.0-rc1 (for testing; 2021-05-06)
|
||||||
* Fix #324 so that `insert-into` supports merging into another statement in all cases.
|
* Fix #324 so that `insert-into` supports merging into another statement in all cases.
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,6 @@
|
||||||
|
|
||||||
(defn- namespace-_ [x] (some-> (namespace x) (str/replace "-" "_")))
|
(defn- namespace-_ [x] (some-> (namespace x) (str/replace "-" "_")))
|
||||||
(defn- name-_ [x] (str/replace (name x) "-" "_"))
|
(defn- name-_ [x] (str/replace (name x) "-" "_"))
|
||||||
(defn- -_ [x] (str/replace x "-" "_"))
|
|
||||||
|
|
||||||
(defn- sqlize-value [x]
|
(defn- sqlize-value [x]
|
||||||
(cond
|
(cond
|
||||||
|
|
@ -215,13 +214,17 @@
|
||||||
(fn [fk _] (param-value (fk)))}))
|
(fn [fk _] (param-value (fk)))}))
|
||||||
|
|
||||||
(defn- format-var [x & [opts]]
|
(defn- format-var [x & [opts]]
|
||||||
(let [c (name x)]
|
;; rather than name/namespace, we want to allow
|
||||||
|
;; for multiple / in the %fun.call case so that
|
||||||
|
;; qualified column names can be used:
|
||||||
|
(let [c (cond-> (str x) (keyword? x) (subs 1))]
|
||||||
(cond (= \% (first c))
|
(cond (= \% (first c))
|
||||||
(let [[f & args] (str/split (subs c 1) #"\.")
|
(let [[f & args] (str/split (subs c 1) #"\.")
|
||||||
quoted-args (map #(format-entity (keyword %) opts) args)]
|
quoted-args (map #(format-entity (keyword %) opts) args)]
|
||||||
[(str (upper-case (-_ f)) "(" (str/join ", " quoted-args) ")")])
|
[(str (upper-case (str/replace f "-" "_"))
|
||||||
|
"(" (str/join ", " quoted-args) ")")])
|
||||||
(= \? (first c))
|
(= \? (first c))
|
||||||
(let [k (keyword (subs (-_ c) 1))]
|
(let [k (keyword (subs c 1))]
|
||||||
(if *inline*
|
(if *inline*
|
||||||
[(sqlize-value (param-value k))]
|
[(sqlize-value (param-value k))]
|
||||||
["?" (->param k)]))
|
["?" (->param k)]))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue