This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-29
Channels
- # aws (1)
- # aws-lambda (2)
- # bangalore-clj (3)
- # beginners (26)
- # boot (25)
- # braveandtrue (1)
- # cider (5)
- # cljsrn (7)
- # clojure (144)
- # clojure-android (2)
- # clojure-czech (1)
- # clojure-greece (3)
- # clojure-italy (17)
- # clojure-poland (5)
- # clojure-russia (25)
- # clojure-spec (9)
- # clojure-uk (100)
- # clojurescript (85)
- # core-async (42)
- # cursive (11)
- # datascript (2)
- # datomic (25)
- # duct (3)
- # emacs (5)
- # figwheel (2)
- # fulcro (49)
- # graphql (16)
- # hoplon (8)
- # klipse (10)
- # leiningen (10)
- # lumo (9)
- # off-topic (12)
- # om (14)
- # onyx (25)
- # planck (34)
- # portkey (6)
- # re-frame (43)
- # reagent (4)
- # remote-jobs (2)
- # ring (36)
- # ring-swagger (1)
- # rum (1)
- # shadow-cljs (187)
- # specter (25)
- # sql (5)
- # unrepl (75)
I think we just found a bug in Datomic or if it isn’t a bug then please tell me why we get an exception which leaks datomic internals? 😛
(d/q ‘[:find ?x :where [?x ?x]] (d/db db-conn))
IllegalArgumentExceptionInfo :db.error/insufficient-binding [?x-1752 ?x] not bound in expression clause: [(= ?x ?x-1752)] datomic.error/arg (error.clj:57)
(d/q ’[:find ?x :where [?x ?x ?x]] (d/db db-conn))
IllegalArgumentExceptionInfo :db.error/insufficient-binding [?x-1773 ?x] not bound in expression clause: [(= ?x ?x-1773)] datomic.error/arg (error.clj:57)
and it complains about a binding which isn’t bound in our expression but that binding is not in the original query, it’s auto generated by Datomic under the hood…
Datomic 0.9.5651 is now available https://forum.datomic.com/t/datomic-0-9-5651-now-available/220
## Changed in 0.9.5651
* Enhancement: Peer server allows arbitrary code in queries.
* Enhancement: Better error messages from peer server.
Is it possible to change the parent of a component entity? ie, move a component entity from one entity to another?
it definitely is, in just case though we accidentally created a duplicate of the parent (unique value got changed in source data) and now have two streams of components that I need to merge…
You can definitely move it. Retract from its existing parent and assert on the new one in the same tx
Then it dawn on me that I could possibly transact [{:db/id component-id :parent/_id new-parent-id …}]
and voila… Except not
yep, got that… in your example, what would the value of component
be?
the whole component entity as a map, or just the entity id
hmm, thanks, let me have a look quick
All transactions expand to a list of primitive :db/add
and :db/retract
operations. Map syntax is sugar for a bunch of db/adds, and transaction functions must return something that eventually bottoms out with db/add or db/retract.
thanks, confirmed your suggestion with retract/add in the same transaction has the desired effect!
it just never occurred to me to tackle it that way around
You could make a transactor fn to perform an atomic swap if you often need to query for the old parent before transacting
I did a little repl test using d/with
, and it didn’t have the behaviour I wanted
I know this was just announced, but any opinions on using global DynamoDB tables with Datomic? https://aws.amazon.com/blogs/aws/new-for-amazon-dynamodb-global-tables-and-on-demand-backup/