<< Back to previous view

[JDBC-68] Optional 'identifer' kwarg should be responsible to keywordize row keys Created: 14/Aug/13  Updated: 15/Sep/13  Resolved: 15/Sep/13

Status: Resolved
Project: java.jdbc
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Shantanu Kumar Assignee: Sean Corfield
Resolution: Declined Votes: 0
Labels: enhancement
Environment:

Clojure (JVM)


Attachments: File identifier-should-keywordize.diff    
Patch: Code

 Description   

Optional 'identifier' kwarg only transforms the string column name to another string; the row keys are always keywordized. In some result parsing cases, where a different transformation may be required the default keywordization would be unnecessary.

A possible solution is to expand the responsibility of 'identifier' to keywordize (default behavior) when required. This solution is attached as a patch to this issue, and passes all tests.



 Comments   
Comment by Sean Corfield [ 14/Aug/13 3:34 PM ]

The problem with this approach is that anyone using the `identifiers` approach - overriding the default behavior - will now have broken code. I'll give it more thought. I think a :keyword? true|false argument, passed thru everything is the only way to maintain backward compatibility but that's a lot of churn so breaking backward compatibility may be the less painful approach (esp. since 0.3.0 is a whole new API anyway).

Comment by Sean Corfield [ 15/Sep/13 4:15 PM ]

java.jdbc has always converted column identifiers to keywords and having keys in maps be keywords is idiomatic in Clojure. If some folks want non-keywords, they can post-process the results.

Adding another option to turn keywords on and off will make the API more complex and breaking compatibility by suddenly not turning the column names into keywords, and forcing a lot of existing code to change, is not acceptable at this point.

Generated at Thu Apr 24 04:27:14 CDT 2014 using JIRA 4.4#649-r158309.