democracyworks / datomic-toolbox Goto Github PK
View Code? Open in Web Editor NEWDatomic Utility Library
Datomic Utility Library
clojure 1.8.0
toolbox 2.0.4
datomic-pro 0.9.5372
(toolbox/initialize {:uri "datomic:mem://cmsdev" :partition :db.part/db})
NullPointerException datomic-toolbox.schema-resource/files (schema_resource.clj:40)
lein clean
and excluding datomic-pro doesn't seem to help. I otherwise have no leads on what the issue is.
Using datomic pro, I see no way to make your :transact
work with ref many to components.
You require that the nested components match perfectly, but use identity on components and de-id them, which means when I pull them I have to try to munge them around. Not only that, but your output does not even say what is expected vs actual.
When I change the implementation to this, it seems to work better, but perhaps you can enlighten me why you treat component refs different from non-component, since they are both entities...seems like checking by db/id is sufficient:
(let [entity (d/entity db eid)
relation (d/entity db rel)
->set (fn [maybe-set]
(cond
(instance? java.util.Collection maybe-set) (set maybe-set)
(nil? maybe-set) #{}
:else #{maybe-set}))
old-values (->set old-value)
new-values (->set new-value)
existing-values (map :db/id (->set (get entity rel)))
de-id (fn [e]
(if (instance? datomic.Entity e)
(into {} e)
e))
actual (set (map de-id existing-values))]
(when-not (= old-values actual)
(throw (java.util.ConcurrentModificationException.
(str "old-values do not match existing values: "
"Info: "
"expected: " (pr-str old-values) "; "
"actual: " (pr-str actual) "; "
"coll? " (instance? java.util.Collection old-value) "; "
"nil? " (nil? old-value) "; "
"type: " (type old-value)))))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.