Skip to content

Instantly share code, notes, and snippets.

@mishok13
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mishok13/9324779 to your computer and use it in GitHub Desktop.
Save mishok13/9324779 to your computer and use it in GitHub Desktop.
=> \d test;
Table "public.test"
Column | Type | Modifiers
--------+---------+-----------
id | integer |
value | integer |
=> select * from test;
id | value
----+-------
1 | 1
2 | 3
3 | 10
(3 rows)
> (require '[honeysql.core :as sql.eng])
nil
> (require '[honeysql.helpers :as sql])
nil
> (defn test-query [conn]
(let [query (-> (apply sql/select [[(sql.eng/call :max :value) "value"]])
(sql/from :test)
sql.eng/build
(sql.eng/format :quoting :ansi))]
;; Where do I put .setFetchSize here?
(->> query
(jdbc/query conn)
first
:value)))
#'/test-query
> (test-query c)
10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment