From 17319cdd26bbd415987e97b20fca9631d762344a Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Sat, 26 Mar 2022 08:28:24 -0700 Subject: [PATCH] #398 treat -> as variadic --- src/honey/sql/pg_json.cljc | 2 +- test/honey/sql/pg_json_test.cljc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/honey/sql/pg_json.cljc b/src/honey/sql/pg_json.cljc index 0ad2899..e22b893 100644 --- a/src/honey/sql/pg_json.cljc +++ b/src/honey/sql/pg_json.cljc @@ -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! :#>>) diff --git a/test/honey/sql/pg_json_test.cljc b/test/honey/sql/pg_json_test.cljc index 003541d..d046135 100644 --- a/test/honey/sql/pg_json_test.cljc +++ b/test/honey/sql/pg_json_test.cljc @@ -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]]})))))