address #353 for create table/string entity

This commit is contained in:
Sean Corfield 2021-09-09 10:41:37 -07:00
parent ec758dd818
commit c7c6102661
2 changed files with 9 additions and 13 deletions

View file

@ -15,10 +15,10 @@ jobs:
distribution: 'adopt' distribution: 'adopt'
java-version: ${{ matrix.java }} java-version: ${{ matrix.java }}
cache: 'maven' cache: 'maven'
- name: Clojure CLI 1.10.3.933 - name: Clojure CLI
uses: DeLaGuardo/setup-clojure@master uses: DeLaGuardo/setup-clojure@master
with: with:
tools-deps: '1.10.3.933' tools-deps: '1.10.3.967'
- name: Run Tests - name: Run Tests
run: clojure -T:build ci run: clojure -T:build ci
- name: Check cljdoc.edn - name: Check cljdoc.edn

View file

@ -220,18 +220,13 @@
(if *quoted-snake* name-_ name) (if *quoted-snake* name-_ name)
name-_) name-_)
quote-fn (if (or *quoted* (string? e)) (:quote *dialect*) identity) 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))] (namespace-_ e))]
[n (col-fn e)] [n (col-fn e)]
(if aliased (if aliased
[nil (col-fn e)] [(col-fn e)]
(let [[t c] (str/split (col-fn e) #"\.")] (str/split (col-fn e) #"\.")))
(if c [t c] [nil t])))) entity (str/join "." (map #(cond-> % (not= "*" %) (quote-fn)) parts))
entity (cond->> col
(not= "*" col)
(quote-fn)
table
(str (quote-fn table) "."))
suspicious #";"] suspicious #";"]
(when-not *allow-suspicious-entities* (when-not *allow-suspicious-entities*
(when (re-find suspicious entity) (when (re-find suspicious entity)
@ -743,8 +738,9 @@
(if (sequential? table) (if (sequential? table)
table table
[table]) [table])
coll (take-while ident? params) tab? #(or (ident? %) (string? %))
opts (drop-while ident? params) coll (take-while tab? params)
opts (drop-while tab? params)
ine (last coll) ine (last coll)
[prequel table ine] [prequel table ine]
(if (= :if-not-exists (sym->kw ine)) (if (= :if-not-exists (sym->kw ine))