A mechanism for reading specialized types from result sets could be useful


  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:


I had this idea when trying to adapt Korma to use with postgres tables with columns of array types. I had some success using Korma's transform functions to convert the java.sql.Array objects into a seq on the way out, but recent changes to Korma seem to indicate that the transform functions are not guaranteed to run before the connection is closed. This interferes with efforts to read the arrays, which I think can be their own result sets.

Presumably korma could be changed to support reading the arrays on the way out, but maybe being able to customize the read behavior within c.j.jdbc would be simpler.

The first idea I've had toward this end is to create a protocol with a single function that objects being read out of the resultset get passed through. It would default to the identity function, but users could e.g. extend it to java.sql.Array. I don't know if there are significant performance implications for an extra function call for each value coming out of the database.

I'll have a patch in this vein attached shortly.

  1. JDBC-46-p1.patch
    23/Jan/13 10:26 AM
    2 kB
    Gary Fredericks
  2. JDBC-46-p2.patch
    23/Jan/13 3:53 PM
    3 kB
    Gary Fredericks
  3. JDBC-46-p3.patch
    11/Apr/13 9:32 PM
    3 kB
    Gary Fredericks



Vote (0)
Watch (0)


  • Created: