diff --git a/src/honey/sql.cljc b/src/honey/sql.cljc index 749a082..1820e51 100644 --- a/src/honey/sql.cljc +++ b/src/honey/sql.cljc @@ -304,7 +304,7 @@ (let [s (first x) a (second x) pair? (= 2 (count x)) - big? (and (ident? s) (= "*" (name s)) + big? (and (ident? s) (or (= "*" (name s)) (str/ends-with? (name s) ".*")) (ident? a) (#{"except" "replace"} (name a))) more? (and (< 2 (count x)) (not big?)) [sql & params] (if (map? s) diff --git a/test/honey/bigquery_test.cljc b/test/honey/bigquery_test.cljc index 1ffe820..0c962fd 100644 --- a/test/honey/bigquery_test.cljc +++ b/test/honey/bigquery_test.cljc @@ -11,6 +11,8 @@ (sut/format {:select [:*] :from [:table] :where [:= :id 1]}))) (is (= ["SELECT * EXCEPT (a, b, c) FROM table WHERE id = ?" 1] (sut/format {:select [[:* :except [:a :b :c]]] :from [:table] :where [:= :id 1]}))) + (is (= ["SELECT table.* EXCEPT (a, b, c) FROM table WHERE id = ?" 1] + (sut/format {:select [[:table.* :except [:a :b :c]]] :from [:table] :where [:= :id 1]}))) (is (= ["SELECT * REPLACE (a * 100 AS b, 2 AS c) FROM table WHERE id = ?" 1] (sut/format {:select [[:* :replace [[[:* :a [:inline 100]] :b] [[:inline 2] :c]]]] :from [:table] :where [:= :id 1]}))) (is (= ["SELECT * EXCEPT (a, b) REPLACE (2 AS c) FROM table WHERE id = ?" 1]