korma / Korma

Tasty SQL for Clojure.
http://sqlkorma.com
1.48k stars 222 forks source link

Documentation on sqlkorma home page is wrong? #208

Closed justinwoo closed 9 years ago

justinwoo commented 10 years ago

I did an insertion and expected the result to be the id of the inserted record, but instead got the entire record back. This contradicts what the docs say about insertion on the homepage where it says:

Insert queries use the function (values) to add records. It takes either a single map or a collection of maps and returns the id of the first inserted record.

This is my result from doing the insertion where it returns me the record:

lokori commented 10 years ago

Yes, we noticed this too. We prefer the implementation over the documentation on this matter by a large margin.

So I suggest that documentation is changed, not the implementation.

immoh commented 10 years ago

Actually the return value depends on the database/driver. PostgreSQL seems to return the whole record, MySQL something like {:generated_key 1} and MSSQL {:generated_keys 1}. But yes, the documentation needs to be updated.