sql

All things SQL and JDBC...
2020-03-16T04:35:55.204400Z

Sorry, I did not notice the alphabetical order.

seancorfield 2020-03-16T05:37:01.204600Z

NP. I'm just really anal about that sort of thing. I ding my colleagues about it in PRs πŸ™‚

seancorfield 2020-03-16T05:37:23.204800Z

I really appreciate that you took the trouble to send a PR in the first place!

kwladyka 2020-03-16T10:02:02.205500Z

Are namepsaces keywords useful in any way with next.jdbc.sql/update! ?

kwladyka 2020-03-16T10:03:13.206600Z

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.

kwladyka 2020-03-16T10:03:32.207100Z

So I have to remove all namespaces keyword here to make this simple

kwladyka 2020-03-16T10:03:51.207500Z

just thinking if I lose any advantage because of this here?

seancorfield 2020-03-16T17:28:27.209300Z

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

πŸ‘ 1
seancorfield 2020-03-16T17:30:19.209800Z

You should stop worrying about qualified keywords and just get used to them πŸ™‚

βž• 1
seancorfield 2020-03-16T17:35:35.212400Z

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.

kwladyka 2020-03-16T17:40:50.213Z

that is what I was thinking, but wanted to be sure if I don’t lose some not obviously advantages