Last active
August 29, 2015 13:56
-
-
Save mishok13/9324779 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=> \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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> (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