The clojure.contrib.sql library returns BigDecimals for all numeric fields. What's a good way to have some fields as Integers? Example code below:
(sql/with-connection my-db
(sql/with-query-results res
[sql-str 6722]
(into [] res)))
In the resulting collection of records all numbers are BigDecimal. Some of these are foreign keys, and for reasons of my own, I need them to be integer.
I know I can iterate over the collection and convert them, but I would rather not do this as it is a very large collection, and it seems right to have the library use ResultsSet.getInteger if the number fits into an integer.
The DB is Oracle, and the integer DB fields are defined as NUMBER(10)
Thanks