This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-24
Channels
- # adventofcode (4)
- # announcements (1)
- # aws (6)
- # babashka (18)
- # babashka-sci-dev (18)
- # beginners (12)
- # calva (43)
- # circleci (3)
- # clj-kondo (96)
- # cljdoc (2)
- # clojure (89)
- # clojure-australia (2)
- # clojure-europe (26)
- # clojure-nl (3)
- # clojure-norway (11)
- # clojure-spec (8)
- # clojure-uk (1)
- # clojurescript (28)
- # cursive (25)
- # datahike (6)
- # datalevin (56)
- # datomic (12)
- # docker (15)
- # emacs (9)
- # events (2)
- # figwheel (3)
- # fulcro (15)
- # gratitude (10)
- # introduce-yourself (8)
- # lsp (16)
- # malli (6)
- # nbb (2)
- # off-topic (23)
- # other-languages (2)
- # pathom (4)
- # portal (25)
- # practicalli (1)
- # re-frame (9)
- # releases (1)
- # shadow-cljs (8)
- # sql (6)
- # timbre (3)
Trying to migrate to next.jdbc
from clojure.java.jdbc
, and I am wondering if there is something really basic that I am missing here.
I am attempting to find an equivalent to :row-fn
as follows.
(j/query ds
["SELECT c1 AS col FROM UNNEST(ARRAY['x', 'y', 'z'])"]
{:row-fn :col})
So far I have some up with this
(mapv :col (j/plan ds
["SELECT c1 AS col FROM UNNEST(ARRAY['x', 'y', 'z'])"]
{:builder-fn rs/as-unqualified-lower-maps}))
But I'm wondering if there is a way to compose the builder-fn with :col
so I can simply use j/execute!
instead of mapping over a plan
.I've tried that and I get an exception 😞
Then I referred to some documentation on differences between clojure.java.jdbc and next.jdbc. If I understood it correctly, I should be able to use something like (partial map :col)
as a function over the record set, but that doesn't work either.
i think at this point it's quicker to just map :col than write your own builder haha
next.jdbc.plan/select!
is what you want