I'm trying to use the next next.jdbc for lazy processing of results from the database using the plan function. But I get an OutOfMemoryError. What am I doing wrong?
(transduce
(map (constantly 1))
+
0
(jdbc/plan db-conn ["select * from sometable limit 1000000"]))You should open a GH issue against the Instant repo about that.
It's worth mentioning that the example from https://github.com/instantdb/instant/blob/deddf0a314c975853170875f95cfe3303189d81d/server/src/instant/jdbc/failover.clj#L271 is not working. Execution with with-open wrapping jdbc/plan returns exception that connection is closed before reducer start doing its work
I kept digging and came across the answer. https://github.com/instantdb/instant/blob/deddf0a314c975853170875f95cfe3303189d81d/server/src/instant/jdbc/failover.clj#L271
You mean :auto-commit false?
Yes, with :fetch-size. I haven't found it in docs
Around here? https://github.com/seancorfield/next-jdbc/blob/develop/doc/tips-and-tricks.md#streaming-result-sets-1
Ahh 🫣 Thx