Fork me on GitHub
#sql
<
2017-10-24
>
borkdude09:10:34

Is there any documentation on how to use reducible-query?

seancorfield16:10:11

@borkdude Not yet, sorry. It's on my list.

borkdude16:10:08

ok, because I think it replaces this right? https://stackoverflow.com/a/39775018/6264

seancorfield16:10:39

Yeah, several things have changed about that SO example: :fetch-size is passed through from query, you can set :auto-commit? false on anything that creates a connection (which could be query or with-db-connection etc).

seancorfield16:10:14

And you can now reduce a reducible-query as a better way to deal with large result sets. Or any result sets 🙂

borkdude16:10:14

OK, I’d like to update my answer over there as soon as the docs come available. Thanks!

seancorfield16:10:53

The problem with streaming result sets is that the settings you need are specific to each vendor's DB.

borkdude16:10:17

I see, so that’s why they become part of the query?

seancorfield16:10:23

Well, some DBs need :auto-commit? false at the point that creates the connection, some don't. Some need a non-zero :fetch-size (on query or reducible-query or prepare-statement).

seancorfield16:10:27

The point is to expose the various knobs that any DB needs -- but how you set those knobs depends on which DB you are using.

seancorfield16:10:22

This was where I added :auto-commit? https://dev.clojure.org/jira/browse/JDBC-153 (and the ability to set a connection to readonly -- both options got ? for consistency)