[org.clojure/java.jdbc “0.7.0-beta4”] is available! It fixes reflection warnings, it passes opts correctly from reducible-query to the underlying prepare-statement, and it completes the optional specs (compared to Beta 1), as well as correctly supporting the docstring contract of reduce.
Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood From: Sean Corfield<mailto:s...@corfield.org> Sent: Tuesday, July 4, 2017 7:27 PM To: Clojure Mailing List<mailto:clojure@googlegroups.com> Subject: RE: [ANN] clojure.java.jdbc 0.7.0 Beta 1 > The required steps to setup streaming are different from database to > database and I guess they may change with the driver version being used. This is really the crux of the problem here – I’m not sure what java.jdbc can do generically to make this much easier. Reviewing the code, you have found a bug! The options passed to reducible-query are passed to the reducible result set but they are not passed to db-query-with-result-set which is where the :fetch-size option should be passed down into prepare-statement. Ugh. I’ll fix that and put out a new release. Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood From: Ralf Schmitt<mailto:r...@systemexit.de> Sent: Tuesday, July 4, 2017 1:29 PM To: Sean Corfield<mailto:s...@corfield.org>; Clojure Mailing List<mailto:clojure@googlegroups.com> Subject: Re: [ANN] clojure.java.jdbc 0.7.0 Beta 1 Sean Corfield <s...@corfield.org> writes: > Did you try this: > > (jdbc/with-db-connection [conn config/db] > (.setAutoCommit (jdbc/db-find-connection conn) false) > (into [] (take 2) (jdbc/reducible-query conn query {:fetch-size 500})) > > (I don’t have your sort of data set to test on with PostgreSQL) Hi Sean, that didn't work, i.e. I got an OutOfMemoryError. Even if it did, it uses a lot of boilerplate code and looks rather 'pale' in comparison to (into [] (take 2) (jdbc/reducible-query conn query {:use-streaming? true})) It would also be nice from a callers perspective since he does not need to know if the query should use streaming; it would be part of the options passed to reducible-query. I think it would make sense to add support for streaming into java.jdbc. I'm not sure if this is feasible. The required steps to setup streaming are different from database to database and I guess they may change with the driver version being used. I think you would need some functionality to let the user hook into the process of setting up a connection for streaming. Though java.jdbc could provide those hooks for some commonly used databases. -- Cheers Ralf -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.