This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-22
Channels
- # announcements (21)
- # aws (7)
- # beginners (105)
- # berlin (1)
- # calva (14)
- # cider (20)
- # clj-kondo (62)
- # cljdoc (7)
- # cljsrn (1)
- # clojure (206)
- # clojure-dev (2)
- # clojure-europe (11)
- # clojure-france (2)
- # clojure-italy (2)
- # clojure-nl (1)
- # clojure-uk (34)
- # clojured (1)
- # clojurescript (52)
- # copenhagen-clojurians (2)
- # core-async (1)
- # cryogen (3)
- # cursive (36)
- # data-science (27)
- # datomic (48)
- # emacs (1)
- # events (1)
- # fulcro (27)
- # hoplon (51)
- # jobs-discuss (1)
- # leiningen (1)
- # nrepl (2)
- # off-topic (52)
- # pathom (43)
- # quil (10)
- # re-frame (11)
- # reitit (28)
- # remote-jobs (2)
- # shadow-cljs (36)
- # sql (12)
- # tools-deps (7)
- # vim (32)
- # xtdb (17)
@seancorfield that works perfectly, thanks.
Just nitpicking here, I have a query -
(helpers/select :id [(sql/call :ST_AsText :location) :sample/location])
which returns -
{:sample/id 1, :location "POINT(32.621431 0.291065)"}
Is it possible to either return both as namespaced keys or neither as namespaced keys, its just that the destructuring will be little more pretty.
Currently this is what I am doing, which is little jarring -
(let [{:keys [location] :cabs/keys [id]} result]
[location id])
something like this would work: (jdbc/execute-one! @datasource sql {:builder-fn rs/as-unqualified-lower-maps})]
@murtaza52 next.jdbc
can only qualify column names where the JDBC driver can provide .getTableName
-- which is empty for computed columns.
Hi, I’m migrating a small project to next.jdbc and I noticed that query
now returns a namespaced hashmap. How do I un-namespace the result?
That whole page is probably worth reading @pablore
(I'd say the whole docs are worth reading if you're just starting to use next.jdbc
-- it should answer all your questions, including DB-specific tips & tricks in the friendly SQL functions section)
I'd also strongly recommend using the primary API (`next.jdbc`) where possible and only using next.jdbc.sql
as a migration aid for legacy code.
thanks @seancorfield!