java.jdbc

insert! is not documented to always return a sequence of generated keys

Details

  • Type: Task Task
  • Status: Resolved Resolved
  • Priority: Trivial Trivial
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    OS X Clojure 1.5.1 clojure.jdbc 0.3-alpha4

Description

The insert! function always returns a sequence of keys even if only one recored is inserted.

Activity

Hide
Sean Corfield added a comment -

This is a documentation issue and the documentation is now editable by the community in its new home on http://clojure-doc.org

Show
Sean Corfield added a comment - This is a documentation issue and the documentation is now editable by the community in its new home on http://clojure-doc.org
Hide
Christian Sperandio added a comment -

I agree with you about the consistency to return always a sequence.
I was afraid about a future change (closer of the insert-record function) that would break the current behavior.

Show
Christian Sperandio added a comment - I agree with you about the consistency to return always a sequence. I was afraid about a future change (closer of the insert-record function) that would break the current behavior.
Hide
Sean Corfield added a comment -

I think this is more consistent than returning a sequence sometimes and a single value other times. If you want the first key, you know you're always safe to call `first` on the result. I'll probably just update the docstring to make that clearer what happens for different circumstances.

Show
Sean Corfield added a comment - I think this is more consistent than returning a sequence sometimes and a single value other times. If you want the first key, you know you're always safe to call `first` on the result. I'll probably just update the docstring to make that clearer what happens for different circumstances.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: