This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-25
Channels
- # bangalore-clj (5)
- # beginners (225)
- # boot (36)
- # cider (1)
- # clara (2)
- # cljsjs (1)
- # clojure (76)
- # clojure-belgium (1)
- # clojure-conj (1)
- # clojure-india (4)
- # clojure-italy (5)
- # clojure-korea (1)
- # clojure-russia (22)
- # clojure-spec (35)
- # clojure-uk (52)
- # clojurescript (67)
- # community-development (17)
- # core-logic (2)
- # cursive (2)
- # datascript (28)
- # datomic (44)
- # emacs (1)
- # funcool (3)
- # hoplon (14)
- # lein-figwheel (2)
- # leiningen (2)
- # luminus (3)
- # midje (3)
- # mount (2)
- # nyc (2)
- # om (54)
- # om-next (1)
- # onyx (30)
- # re-frame (57)
- # reagent (19)
- # ring-swagger (23)
- # slack-help (10)
- # spacemacs (2)
- # specter (1)
- # vim (23)
Ok, one more strange question - if I want to preserve history in datascript, I just store old values in persistent vector [db1, db2, db3, ..]
but if I store then vector to disk, and reload it back again, it will eat up much more memory, right? there is no way to serialize structural sharing in underlying datastructures?
I wish I would be in shape one day to combine datascript and drgnbrg outboard project 🙂
if I want to :db/retract an attribute but specify a value of a different type than the current value, I get a class cast exception
is that something that should be fixed?
usecase here is that the current db’s value is a lookup ref, and I accidentally provided a string instead.
is current value a string or a lookup ref (vector, right?). What have you provided for that attribute in schema?
are there other values in db under the same attribute? Are they of different type or the same one?
(but easiest way to fix that is just to recreate a DB and don’t put what you don’t want to be there)
the problem is that if I make a mistake and provide the wrong value of the wrong type in a retract transaction, that will cause an exception
so far I’ve not attempted to build a system that uses multiple types of value for the same attribute, but I’m assuming that would cause an exception too
the main problem is that it’s very hard to figure out what was happening at all.
I would probably be happier if the retraction just had no effect if the values don’t match, regardless of type
the current value is a vector (lookup ref) with matching {:db/unique :db.unique/identity} schema
but the provided value is someting like [:db/retract eid :something/else “my-id”]
instead of [:db/retract eid :something/else [:my/ref “my-id”]]
so that’s a mistake on my part. I just found it hard to figure out what the problem was at all given java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IPersistentVector
@joost-diepenmaat it is not a good idea to have something fail silently on a library level.