From d7c7f15a6b4115003798037fea44ef24f5077a72 Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Mon, 1 Feb 2021 16:24:00 -0800 Subject: [PATCH] Final de-?-ing keyword arguments/options --- src/honey/sql.cljc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/honey/sql.cljc b/src/honey/sql.cljc index 59251d1..1f8e0f8 100644 --- a/src/honey/sql.cljc +++ b/src/honey/sql.cljc @@ -823,12 +823,12 @@ "Register a new infix operator. Operators can be defined to be variadic (the default is that they are binary) and may choose to ignore `nil` arguments (this can make it easier to programmatically construct the DSL)." - [op & {:keys [variadic? ignore-nil?]}] + [op & {:keys [variadic ignore-nil]}] (assert (keyword? op)) (swap! infix-ops conj op) - (when variadic? + (when variadic (swap! op-variadic conj op)) - (when ignore-nil? + (when ignore-nil (swap! op-ignore-nil conj op))) (comment @@ -865,4 +865,10 @@ [:= :bar [:param :quux]]]} {:params {:foo 42 :quux 13} :pretty true})) + ;; while working on the docs + (require '[honey.sql :as sql]) + (sql/format {:select [:*] :from [:table] :where [:= :id 1]}) + (sql/format {:select [:*] :from [:table] :where [:= :id 1]} {:dialect :mysql}) + (sql/format {:select [:foo/bar] :from [:q-u-u-x]} {:quoted true}) + (sql/format {:select ["foo/bar"] :from [:q-u-u-x]} {:quoted true}) ,)