Created
July 13, 2014 01:50
-
-
Save teaforthecat/d5921a1516f27877ddda to your computer and use it in GitHub Desktop.
broken upsert transaction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; implicit upsert due to unique constraint on message | |
;; temp id will get replaced with real id if message exists | |
(defn upsert-message-tx [greeting] | |
(let [tempid (d/tempid :db.part/user -1 )] | |
[{ :db/id tempid | |
:greeting/message greeting} | |
[:inc tempid :greeting/hit-count 1]])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment