diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d2c18a6..d89ed56 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,10 +15,10 @@ jobs: distribution: 'adopt' java-version: ${{ matrix.java }} cache: 'maven' - - name: Clojure CLI 1.10.3.933 + - name: Clojure CLI uses: DeLaGuardo/setup-clojure@master with: - tools-deps: '1.10.3.933' + tools-deps: '1.10.3.967' - name: Run Tests run: clojure -T:build ci - name: Check cljdoc.edn diff --git a/src/honey/sql.cljc b/src/honey/sql.cljc index a30135f..0fa10dd 100644 --- a/src/honey/sql.cljc +++ b/src/honey/sql.cljc @@ -220,18 +220,13 @@ (if *quoted-snake* name-_ name) name-_) quote-fn (if (or *quoted* (string? e)) (:quote *dialect*) identity) - [table col] (if-let [n (when-not (or drop-ns (string? e)) + parts (if-let [n (when-not (or drop-ns (string? e)) (namespace-_ e))] [n (col-fn e)] (if aliased - [nil (col-fn e)] - (let [[t c] (str/split (col-fn e) #"\.")] - (if c [t c] [nil t])))) - entity (cond->> col - (not= "*" col) - (quote-fn) - table - (str (quote-fn table) ".")) + [(col-fn e)] + (str/split (col-fn e) #"\."))) + entity (str/join "." (map #(cond-> % (not= "*" %) (quote-fn)) parts)) suspicious #";"] (when-not *allow-suspicious-entities* (when (re-find suspicious entity) @@ -743,8 +738,9 @@ (if (sequential? table) table [table]) - coll (take-while ident? params) - opts (drop-while ident? params) + tab? #(or (ident? %) (string? %)) + coll (take-while tab? params) + opts (drop-while tab? params) ine (last coll) [prequel table ine] (if (= :if-not-exists (sym->kw ine))