This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-16
Channels
- # autochrome-github (17)
- # aws (6)
- # babashka (19)
- # beginners (42)
- # bristol-clojurians (1)
- # calva (1)
- # cider (7)
- # clara (1)
- # clj-kondo (6)
- # cljdoc (17)
- # cljs-dev (5)
- # clojars (23)
- # clojure (93)
- # clojure-europe (20)
- # clojure-italy (28)
- # clojure-nl (13)
- # clojure-sanfrancisco (1)
- # clojure-uk (50)
- # clojuredesign-podcast (5)
- # clojurescript (90)
- # core-async (8)
- # datomic (23)
- # duct (3)
- # emacs (10)
- # figwheel-main (1)
- # fulcro (1)
- # malli (1)
- # meander (22)
- # off-topic (12)
- # pathom (57)
- # reitit (4)
- # remote-jobs (5)
- # shadow-cljs (5)
- # sql (8)
- # tools-deps (3)
I am asking, because I want to do fn like this
(defn update-by-uuid! [table data] (sql/update! db table data {:uuid (:uuid data}))
And I hav concern about :uuid
, because here will be :shop/uuid
os something else.You are over-thinking. The docs talk about this and you can pass qualified or unqualified names and both will work in update!
etc @kwladyka
👍 4
You should stop worrying about qualified keywords and just get used to them 🙂
➕ 4
In other words, both of the following will work:
(defn update-by-uuid! [table data] (sql/update! db table data {:shop/uuid (:uuid data}))
(defn update-by-uuid! [table data] (sql/update! db table data {:uuid (:uuid data}))
and so would
(defn update-by-uuid! [table data] (sql/update! db table data (select-keys data [:uuid]))) ; if data has simple keys
(defn update-by-uuid! [table data] (sql/update! db table data (select-keys data [:shop/uuid]))) ; if data has qualified keys
The whole point (of next.jdbc
working this way) is to allow you to use qualified keys easily.