Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(spec/def :datascript.db/id int?)
(spec/def :datomic.db/id #(instance? DbId %))
(spec/def :db/id (spec/or :datascript :datascript.db/id
:datomic :datomic.db/id))
(defn datomic-id?
"Checks a conformed spec and ensures the :db/id was a datomic id"
[{[kw] :db/id}]
(= kw :datomic))
(defn datascript-id?
"Checks a conformed spec and ensures the :db/id was a datascript id"
[{[kw] :db/id}]
(= kw :datascript))
(spec/def :object.abstract/schema (spec/keys :req [:db/id]))
(spec/def :object.from-client/schema
(spec/and :object.abstract/schema
datascript-id?))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment