<!-- 
RSS generated by JIRA (4.4#649-r158309) at Sat May 18 09:43:37 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-3/JDBC-3.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-3] Inconsistency between tuples and regular maps</title>
                <link>http://dev.clojure.org/jira/browse/JDBC-3</link>
                <project id="10021" key="JDBC">java.jdbc</project>
                        <description>&lt;p&gt;Stuart Sierra: In general, c.c.sql is inconsistent about using tuples of column values versus maps of column=&amp;gt;value pairs. Both are useful, and I&apos;d like to see versions of all the core functions that support both modes.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14418">JDBC-3</key>
            <summary>Inconsistency between tuples and regular maps</summary>
                <type id="3" iconUrl="http://dev.clojure.org/jira/images/icons/task.gif">Task</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</priority>
                    <status id="5" iconUrl="http://dev.clojure.org/jira/images/icons/status_resolved.gif">Resolved</status>
                    <resolution id="3">Duplicate</resolution>
                                <assignee username="seancorfield">Sean Corfield</assignee>
                                <reporter username="seancorfield">Sean Corfield</reporter>
                        <labels>
                    </labels>
                <created>Sun, 8 May 2011 21:15:04 -0500</created>
                <updated>Wed, 12 Oct 2011 16:29:40 -0500</updated>
                    <resolved>Wed, 12 Oct 2011 16:29:40 -0500</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="26722" author="seancorfield" created="Sat, 13 Aug 2011 18:59:49 -0500"  >&lt;p&gt;Having reviewed this after using the library for quite a while, I don&apos;t really see any inconsistencies except, perhaps in the naming of update-values (and update-or-insert-values).&lt;/p&gt;

&lt;p&gt;insert-values is the base function, taking a table name, a vector of column names and any number of vectors of column values. Generates one insert statement (containing multiple rows). If only one row is inserted, returns a map of generated keys if the database supports that.&lt;/p&gt;

&lt;p&gt;insert-rows takes a table name and any number of vectors of column values (for all columns); uses insert-values.&lt;/p&gt;

&lt;p&gt;insert-records takes a table name and any number of maps (containing column/value pairs); uses insert-values to insert one record at a time (and thus may return a sequence of maps of generated keys).&lt;/p&gt;

&lt;p&gt;insert-record takes a table name and a single map; uses insert-records and returns a map of generated key if the database supports that.&lt;/p&gt;

&lt;p&gt;delete-rows takes a table name and a where clause. Perhaps delete-where might be a better name?&lt;/p&gt;

&lt;p&gt;update-values takes a table name, a where clause and a map (of column/value pairs to update). Arguably this should be renamed since it doesn&apos;t take the same argument pattern as insert-values, but whilst update-records might sound more appropriate it only takes one &quot;record&quot; and update-record is clearly not right since it can update more than one row!&lt;/p&gt;

&lt;p&gt;update-or-insert-values (taking the same arguments as update-values) can however lead to inserting a single record but it can also update multiple records instead.&lt;/p&gt;

&lt;p&gt;On both of the latter functions, an analogy could be drawn with the findAndModify command in MongoDB which has an upsert option (to insert the document if no matches are found for the update), but most notably, findAndModify only updates a single record. I don&apos;t believe SQL has any portable equivalent but perhaps find-and-modify is a better name for update-values? Or perhaps, in the spirit of my suggestion for delete-where, we might call it update-where - and use an optional keyword argument to indicate that an insert-record should be performed when no rows match?&lt;/p&gt;

&lt;p&gt;The only other comment I could make on update-values is that it might be nice to have a variant that took: table where-params column-names value-group - somewhat inline with insert-values (although not allowing any number of vectors of column values).&lt;/p&gt;</comment>
                    <comment id="26948" author="seancorfield" created="Wed, 12 Oct 2011 16:29:12 -0500"  >&lt;p&gt;The API aspects of this ticket are covered in &lt;a href=&quot;http://dev.clojure.org/jira/browse/JDBC-20&quot; title=&quot;Create new clean API that accepts connection etc (post 0.1.0)&quot;&gt;&lt;del&gt;JDBC-20&lt;/del&gt;&lt;/a&gt; (post 0.1.0) and the struct-map issue is covered in &lt;a href=&quot;http://dev.clojure.org/jira/browse/JDBC-15&quot; title=&quot;resultset-seq uses structmap which has been deprecated&quot;&gt;&lt;del&gt;JDBC-15&lt;/del&gt;&lt;/a&gt; so I&apos;m closing this out as a duplicate for now.&lt;/p&gt;</comment>
                    <comment id="26949" author="seancorfield" created="Wed, 12 Oct 2011 16:29:40 -0500"  >&lt;p&gt;Essentially duplicated with more focus in &lt;a href=&quot;http://dev.clojure.org/jira/browse/JDBC-15&quot; title=&quot;resultset-seq uses structmap which has been deprecated&quot;&gt;&lt;del&gt;JDBC-15&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;http://dev.clojure.org/jira/browse/JDBC-20&quot; title=&quot;Create new clean API that accepts connection etc (post 0.1.0)&quot;&gt;&lt;del&gt;JDBC-20&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </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>