This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-19
Channels
- # announcements (1)
- # babashka (40)
- # beginners (84)
- # biff (46)
- # calva (37)
- # cherry (2)
- # cider (18)
- # clj-otel (5)
- # clojure (53)
- # clojure-europe (39)
- # clojure-hungary (12)
- # clojure-norway (40)
- # clojure-sweden (2)
- # clojure-uk (2)
- # clojurescript (6)
- # community-development (21)
- # cursive (28)
- # data-science (12)
- # datomic (3)
- # figwheel-main (2)
- # fulcro (12)
- # graalvm (7)
- # gratitude (1)
- # hyperfiddle (23)
- # integrant (9)
- # jobs (2)
- # leiningen (4)
- # lsp (8)
- # malli (3)
- # missionary (1)
- # off-topic (39)
- # polylith (3)
- # portal (33)
- # practicalli (4)
- # re-frame (3)
- # releases (1)
- # sci (53)
- # solo-full-stack (8)
- # sql (5)
- # timbre (9)
Hi. I'm working on a query that can potentially return thousands of rows. The goal is to write the result into a CSV file. I guess that next.jdbc/plan
is the way to go, but I'm not sure what to do with the Reducible that it returns. All the examples that I find (using reduce
, transduce
, etc) are transforming or aggregating the data. But in my case I just want to write the data to a file and immediately discard it. So I wonder if I'm in the right path. Any hints?
Use reduce
. The "transform" will write a row to the csv file (and can return nil
). You could probably use run!
That uses reduce
under the hood.
That sounds good! Thanks
Thanks for the suggestion igrishaev. Already implemented it using next.jdbc/plan
, and works like a charm for our use case. But it's good to know there are more options.