sql

k3nj1g 2025-02-26T11:08:57.333229Z

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"]))

seancorfield 2025-02-28T16:18:10.378169Z

You should open a GH issue against the Instant repo about that.

k3nj1g 2025-02-28T07:59:36.200339Z

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

p-himik 2025-02-26T11:19:16.246349Z

You mean :auto-commit false?

k3nj1g 2025-02-26T11:21:06.100299Z

Yes, with :fetch-size. I haven't found it in docs

k3nj1g 2025-02-26T12:01:52.010189Z

Ahh 🫣 Thx

🚀 2