From b32911d8084e64389cde4eb69b73882c75c08775 Mon Sep 17 00:00:00 2001 From: Sean Corfield Date: Mon, 21 Jun 2021 14:50:55 -0700 Subject: [PATCH] Fix bug in unrolling with-columns args --- src/honey/sql/helpers.cljc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/honey/sql/helpers.cljc b/src/honey/sql/helpers.cljc index 98aa5d7..11809f9 100644 --- a/src/honey/sql/helpers.cljc +++ b/src/honey/sql/helpers.cljc @@ -221,12 +221,15 @@ which used to be needed for DDL)." {:arglists '([& col-specs] [col-spec-coll])} [& args] - ;; special case so (with-columns [[:col-1 :definition] [:col-2 :definition]]) + ;; special cases so (with-columns [[:col-1 :definition] [:col-2 :definition]]) ;; also works in addition to (with-columns [:col-1 :definition] [:col-2 :definition]) (cond (and (= 1 (count args)) (sequential? (first args)) (sequential? (ffirst args))) - (generic-1 :with-columns args) - (and (= 2 (count args)) (sequential? (second args)) (sequential? (fnext args))) - (generic-1 :with-columns args) + (generic :with-columns (cons {} (first args))) + (and (= 2 (count args)) + (map? (first args)) + (sequential? (second args)) + (sequential? (first (second args)))) + (generic :with-columns (cons (first args) (second args))) :else (generic :with-columns args)))