This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-18
Channels
- # announcements (4)
- # aws (24)
- # babashka (118)
- # babashka-sci-dev (18)
- # beginners (56)
- # calva (2)
- # clojure (54)
- # clojure-dev (8)
- # clojure-europe (25)
- # clojure-gamedev (5)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-uk (2)
- # conjure (1)
- # core-async (1)
- # data-science (3)
- # datomic (5)
- # emacs (8)
- # fulcro (4)
- # hyperfiddle (12)
- # interop (1)
- # jackdaw (4)
- # lsp (5)
- # mid-cities-meetup (5)
- # nbb (32)
- # off-topic (21)
- # reitit (5)
- # shadow-cljs (12)
- # sql (8)
- # vim (18)
- # xtdb (9)
I believe this should do the right thing, but I'm getting a vector of just one record repeated ... where am I being stupid?
(transduce (take 32) conj [] (next.jdbc/plan blah ["select distinct stuff from somewhere"]))
You are not processing the rows -- I think the docs specifically warn against that not working as expected.
cool -- thanks. apologies, I had read the docs months ago, was just picking up this code again. nice library, btw -- thanks!
I don't know that there's an explicit warning about just trying to pour unprocessed rows into a collection -- that could perhaps be made clearer in the docs -- but the bottom line is that the "row" you get from plan
is not a Clojure data structure (per the docs) which you must process in your reducing function to produce Clojure data from.
(and the underlying thing that not-a-Clojure-data-structure wraps is a mutable Java object -- which is why you seemed to get a repeated row in your results)