<!-- 
RSS generated by JIRA (4.4#649-r158309) at Sat May 18 23:22:57 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://dev.clojure.org/jira/si/jira.issueviews:issue-xml/JDBC-46/JDBC-46.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Clojure JIRA</title>
    <link>http://dev.clojure.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>4.4</version>
        <build-number>649</build-number>
        <build-date>25-07-2011</build-date>
    </build-info>

<item>
            <title>[JDBC-46] A mechanism for reading specialized types from result sets could be useful</title>
                <link>http://dev.clojure.org/jira/browse/JDBC-46</link>
                <project id="10021" key="JDBC">java.jdbc</project>
                        <description>&lt;p&gt;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&apos;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;The first idea I&apos;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&apos;t know if there are significant performance implications for an extra function call for each value coming out of the database.&lt;/p&gt;

&lt;p&gt;I&apos;ll have a patch in this vein attached shortly.&lt;/p&gt;</description>
                <environment></environment>
            <key id="15975">JDBC-46</key>
            <summary>A mechanism for reading specialized types from result sets could be useful</summary>
                <type id="4" iconUrl="http://dev.clojure.org/jira/images/icons/improvement.gif">Enhancement</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="5" iconUrl="http://dev.clojure.org/jira/images/icons/status_resolved.gif">Resolved</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="seancorfield">Sean Corfield</assignee>
                                <reporter username="gfredericks">Gary Fredericks</reporter>
                        <labels>
                    </labels>
                <created>Wed, 23 Jan 2013 09:23:06 -0600</created>
                <updated>Wed, 15 May 2013 09:52:03 -0500</updated>
                    <resolved>Fri, 19 Apr 2013 21:34:49 -0500</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="30472" author="gfredericks" created="Wed, 23 Jan 2013 10:26:21 -0600"  >&lt;p&gt;Attached patch. Is there any straightforward way to test this? Or a place it should be documented?&lt;/p&gt;</comment>
                    <comment id="30473" author="seancorfield" created="Wed, 23 Jan 2013 10:48:27 -0600"  >&lt;p&gt;Docs: just needs good docstring since the clojure.github.com site is auto-generated from those (although it is still triggered manually it seems).&lt;/p&gt;

&lt;p&gt;Test: mvn test&lt;/p&gt;

&lt;p&gt;I have Derby, HSQLDB, MySQL, MS SQL Server (two drivers), MySQL. I don&apos;t have Postgres to test against. By default mvn test only tries Derby, HSQLDB and SQLite. TEST_DBS=... mvn test will test more.&lt;/p&gt;</comment>
                    <comment id="30474" author="seancorfield" created="Wed, 23 Jan 2013 10:49:43 -0600"  >&lt;p&gt;Would be nice to have a test with a custom conversion, mapping any String to some constant perhaps? Perhaps a separate test ns that is required and tested from test_jdbc.clj?&lt;/p&gt;</comment>
                    <comment id="30475" author="gfredericks" created="Wed, 23 Jan 2013 14:38:59 -0600"  >&lt;p&gt;Oh, we have to be careful with testing because I believe any extensions to the protocol are going to be effective for all the remaining tests, right?&lt;/p&gt;</comment>
                    <comment id="30476" author="gfredericks" created="Wed, 23 Jan 2013 15:53:25 -0600"  >&lt;p&gt;Attached new patch with docstrings and a test. I&apos;ve only run the tests with MySQL. Let me know if there&apos;s anything else I can do.&lt;/p&gt;</comment>
                    <comment id="30507" author="gfredericks" created="Tue, 29 Jan 2013 16:37:21 -0600"  >&lt;p&gt;This patch recently came in handy in an different situation, when jdbc was returning Integers instead of Longs, we had a really clean spot to do the conversion.&lt;/p&gt;</comment>
                    <comment id="30899" author="seancorfield" created="Sun, 7 Apr 2013 03:44:18 -0500"  >&lt;p&gt;There have been a lot of code changes since you submitted the patch and right now the patch doesn&apos;t apply. Can you re-submit the patch against the latest master branch so I can try again? Thanx!&lt;/p&gt;</comment>
                    <comment id="30933" author="gfredericks" created="Thu, 11 Apr 2013 21:32:21 -0500"  >&lt;p&gt;I&apos;m getting 3 test failures on master currently (with a basic &lt;tt&gt;mvn test&lt;/tt&gt;), and after applying this new patch (p3) I still get 3 failures. So hopefully that means I didn&apos;t break anything.&lt;/p&gt;</comment>
                    <comment id="30978" author="seancorfield" created="Fri, 19 Apr 2013 21:34:49 -0500"  >&lt;p&gt;Applied. Will be in 0.3.0-alpha2&lt;/p&gt;</comment>
                    <comment id="31091" author="gfredericks" created="Wed, 15 May 2013 09:52:03 -0500"  >&lt;p&gt;I&apos;m thinking this feature is no longer necessary due to the :row-fn option &amp;#8211; since the only motivation in the first place was to have the opportunity to transform a result before the connection closes.&lt;/p&gt;

&lt;p&gt;There would still be no easy way to do it from Korma, but that&apos;s Korma&apos;s fault. So maybe we should remove this before 0.3.0 is released?&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11812" name="JDBC-46-p1.patch" size="1923" author="gfredericks" created="Wed, 23 Jan 2013 10:26:21 -0600" />
                    <attachment id="11813" name="JDBC-46-p2.patch" size="3560" author="gfredericks" created="Wed, 23 Jan 2013 15:53:25 -0600" />
                    <attachment id="11953" name="JDBC-46-p3.patch" size="3549" author="gfredericks" created="Thu, 11 Apr 2013 21:32:21 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>
</channel>
</rss>