On Wed, Jul 20, 2011 at 7:15 AM, Mark Nutter <manutte...@gmail.com> wrote: >> * Add support for databases that cannot return generated keys (e.g., HSQLDB) >> - insert operations silently return the insert counts instead of >> generated keys >> - it is the user's responsibility to handle this if you're using >> such a database! > > If I'm understanding this correctly, this means that inserting 4 rows > will return "4" instead of a list of 4 generated keys, is that right? > If so, what would you think about having it return a list of 4 zeroes > instead? It would still be up to the user to handle the zero as a > special case, but the structure would be more parallel with other db's > results, and you could test based on the "key" itself instead of > having to refer to some global *db-type* var for your if statement.
+1, except it shouldn't be zeros, it should be nils. Nil is obviously not a valid generated key and is, furthermore, the traditional OOB value to use in situations like this that seem to demand one. -- Protege: What is this seething mass of parentheses?! Master: Your father's Lisp REPL. This is the language of a true hacker. Not as clumsy or random as C++; a language for a more civilized age. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en