Fork me on GitHub
#sql
<
2021-11-11
>
seancorfield00:11:40

@mbarillier You can't use lazy sequences safely with JDBC queries because the connection has to be managed (opened/closed) around the processing of the data.

seancorfield00:11:44

If you use execute! you get a vector. If you use plan, you must reduce the result (or transduce it). Either way, the processing must be eager.

mbarillier00:11:56

@seancorfield fark ..... okee, thanks

seancorfield00:11:46

What problem are you trying to solve that has you reaching for lazy sequences in the first place?

mbarillier00:11:13

reading a large dataset from a db, want to push it through a filter/transform (lazily) prior to user code processing it with transduce/`reduce`. transforms I want to perform within the "lazy-seq" part is probably more complex than I'd like to perform with sql.

mbarillier00:11:14

this is true -- not going to dismiss that solution, thx!

dpsutton00:11:54

perhaps you can compose your filter/transform into the transducer

👍 1
mbarillier00:11:58

I was preferring to create a stream of processed records, with the xform baked inside the lazy seq, but it's looking like that's going to be problematic. I'll re-engineer the api, won't be quite as sexy, but it'll work. thanks, all ......