jacobobryant / biff

A Clojure web framework for solo developers.
https://biffweb.com
MIT License
877 stars 41 forks source link

Add :db/op :create (Issue #125) #130

Closed N-litened closed 2 years ago

N-litened commented 2 years ago

Added a new :db/op — :create, which ensures that no entity with the same :xt/id existed before. Mostly useful with :db/lookup, to ensure that when creating an entity with unique constraints, you don't accidentally overwrite an entity you might have created before if you don't want that.

Like :put, but will succeed only if no entity with this :xt/id existed before. Like :update, but will fail in reverse, when old version does exist (and without "applying special vals").

jacobobryant commented 2 years ago

Thanks!