funcool / funcool/clojure.jdbc

Docs: clarify cursor behavior

オープン
#44 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Clojure
スター
106
フォーク
23
PR マージ指標
30日以内にマージされた PR はありません

説明

Using clojure.jdbc w/ Hikari CP and Postgresql 11.

When attempting to create a cursor as described in the docs the process still ends up trying to load the whole result set into memory.

``` clojure
(def conn (jdbc/connection pool))
(def cursor (jdbc/fetch-lazy conn "SELECT \"uuid\", data_bytes FROM visitor_data;"))
(def cursor-seq (jdbc/cursor->lazyseq cursor)) ;; hangs here
```

If I explicitly set auto-commit and the fetch size I don't have that problem:
``` clojure
(def conn (jdbc/connection pool))
(def cursor (jdbc/fetch-lazy conn "SELECT \"uuid\", data_bytes FROM visitor_data;"))
(.setFetchSize (.-stmt cursor) 50)
(.setAutoCommit (.getConnection (.-stmt cursor)) false)
(def cursor-seq (jdbc/cursor->lazyseq cursor))
```

is this a documentation problem or is the library expected to modify those settings for us?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。