#398 treat -> as variadic

This commit is contained in:
Sean Corfield 2022-03-26 08:28:24 -07:00
parent af69f12630
commit 17319cdd26
2 changed files with 5 additions and 2 deletions

View file

@ -23,7 +23,7 @@
(def at? "The @? operator." (keyword "@?"))
(def atat "The @@ operator." (keyword "@@"))
(sql/register-op! :->)
(sql/register-op! :-> :variadic true)
(sql/register-op! :->>)
(sql/register-op! :#>)
(sql/register-op! :#>>)

View file

@ -36,4 +36,7 @@
(is (= ["SELECT a @?? b AS x"]
(sql/format {:select [[[sut/at? :a :b] :x]]})))
(is (= ["SELECT a @@ b AS x"]
(sql/format {:select [[[sut/atat :a :b] :x]]})))))
(sql/format {:select [[[sut/atat :a :b] :x]]}))))
(testing "variadic ops"
(is (= ["SELECT a -> b -> c AS x"]
(sql/format {:select [[[:-> :a :b :c] :x]]})))))