Merge pull request #132, allow namespaced keywords
This commit is contained in:
commit
e0072efbdc
3 changed files with 10 additions and 1 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
## 0.8.3 In development
|
## 0.8.3 In development
|
||||||
|
|
||||||
|
* Allow namespaced keywords and symbols for queries. (@jrdoane)
|
||||||
|
|
||||||
## 0.8.2
|
## 0.8.2
|
||||||
|
|
||||||
* Don't parenthesize the subclauses of a UNION, UNION ALL, or INTERSECT clause. (@rnewman)
|
* Don't parenthesize the subclauses of a UNION, UNION ALL, or INTERSECT clause. (@rnewman)
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,10 @@
|
||||||
(quote-fns style)
|
(quote-fns style)
|
||||||
*quote-identifier-fn*)
|
*quote-identifier-fn*)
|
||||||
s (cond
|
s (cond
|
||||||
(or (keyword? x) (symbol? x)) (name-transform-fn (name x))
|
(or (keyword? x) (symbol? x))
|
||||||
|
(name-transform-fn
|
||||||
|
(str (when-let [n (namespace x)]
|
||||||
|
(str n "/")) (name x)))
|
||||||
(string? x) (if qf x (name-transform-fn x))
|
(string? x) (if qf x (name-transform-fn x))
|
||||||
:else (str x))]
|
:else (str x))]
|
||||||
(if-not qf
|
(if-not qf
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,10 @@
|
||||||
(is (= (quote-identifier :foo-bar.moo-bar :style :ansi)
|
(is (= (quote-identifier :foo-bar.moo-bar :style :ansi)
|
||||||
"\"foo-bar\".\"moo-bar\""))))
|
"\"foo-bar\".\"moo-bar\""))))
|
||||||
|
|
||||||
|
(deftest test-namespaced-identifier
|
||||||
|
(is (= (quote-identifier :foo/bar) "foo/bar"))
|
||||||
|
(is (= (quote-identifier :foo/bar :style :ansi) "\"foo/bar\"")))
|
||||||
|
|
||||||
(deftest test-cte
|
(deftest test-cte
|
||||||
(is (= (format-clause
|
(is (= (format-clause
|
||||||
(first {:with [[:query {:select [:foo] :from [:bar]}]]}) nil)
|
(first {:with [[:query {:select [:foo] :from [:bar]}]]}) nil)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue