Fork me on GitHub

@seancorfield I am sorry, I am looking at the docs and source of next.jdbc but fail to find how to access the raw ResultSet. Could you be so kind and point me in the right direction? (I want to call .getLong instead of the default .getObject, to try to get a timestamp as a number instead of a Date). I guess I could supply {:builder-fn my-builder} to plan, where my-builder returns my own implementation of RowBuilder. Is that correct? Is there a better way? Or perhaps it is easier to use JDBC directly...


@holyjak Here is what I did to have sql timestamps returned differently:

(extend-protocol result-set/ReadableColumn


  (read-column-by-label ^java.time.ZonedDateTime [^java.sql.Timestamp v _]
    (time/zoned-date-time (time/instant v) "UTC"))
  (read-column-by-index ^java.time.ZonedDateTime [^java.sql.Timestamp v _2 _3]
    (time/zoned-date-time (time/instant v) "UTC"))
Could you just (.getLong v) above, or something similar to get what you want?


@holyjak As @dcj suggested, you'd need to extend ReadableColumn to get the behavior you want. Another option is to extend RowBuilder and ResultSetBuilder to create a custom builder but you're taking on a lot more control in that approach.