Coder Social home page Coder Social logo

datomic-toolbox's People

Contributors

cap10morgan avatar danielglauser avatar ericnormand avatar nherzing avatar sduckett avatar tie-rack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

datomic-toolbox's Issues

NullPointerException datomic-toolbox.schema-resource/files

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.

Components are not handled properly

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)))))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.