This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-27
Channels
- # alda (21)
- # announcements (7)
- # beginners (70)
- # boot (95)
- # braid-chat (28)
- # bristol-clojurians (2)
- # cider (22)
- # clara (4)
- # cljsjs (13)
- # cljsrn (40)
- # clojure (93)
- # clojure-argentina (1)
- # clojure-art (1)
- # clojure-miami (3)
- # clojure-norway (1)
- # clojure-portugal (2)
- # clojure-russia (39)
- # clojure-sg (3)
- # clojurescript (25)
- # clojurian-chat-app (4)
- # community-development (5)
- # conf-proposals (20)
- # cursive (48)
- # datomic (39)
- # devcards (5)
- # dirac (4)
- # editors (2)
- # events (11)
- # funcool (65)
- # hoplon (95)
- # jobs (12)
- # ldnclj (4)
- # lein-figwheel (2)
- # leiningen (1)
- # om (311)
- # onyx (20)
- # philosophy (4)
- # proton (41)
- # re-frame (83)
- # reagent (49)
- # ring-swagger (3)
- # spacemacs (8)
- # yada (5)
hi guys what is the proper way to update refs in datomic ? Normally I transact many ref like this :user/comments #{1 2 4 5}
but when I re update it with :user/comments #{1 2}
. It doesn't seem to change
I find it helpful to remember that the map form of transactions always expands to vector forms that begin with :db/add
so, your original transaction expands to [[:db/add 123 :user/comments 1] [:db/add 123 :user/comments 2] [:db/add 123 :user/comments 4] [:db/add 123 :user/comments 5]]
and your second transaction expands to [[:db/add 123 :user/comments 1] [:db/add 123 :user/comments 2] ]
, which means you're just re-asserting 1 and 2, but not doing anything with the already-existing 4 and 5
hmm, that explains. so if I have to do it manually I have to do [[:db/remove :user/comments 4]]
?
for example if I want to 'just update' then I have to retract all and add the new ones ( most simple way ) or I have to find which one is new and which is not then explicitly add or retract those ( which is more complex )
I suppose I should point out that this only applies to :cardinality/many
attributes. For :cardinality/one
, datomic will do the retraction for you
I just found out this gist, stuart does point out how to retract all refs. https://gist.github.com/stuarthalloway/2948756
@ebahsini: java or clojure ? There are tutorials on frontend page of datomic ( it's in java ) and another one in clojure in a Datomic org on github. You can find it right away.
can not add partition and enum type at the same transact
{:db/id #db/id[:db.part/db]
:db/ident :table
:db.install/_partition :db.part/db}
[:db/add #db/id[:table] :db/ident :resource.type/table]
First, I install partition table
. And then add entity to this partition. It will throw exception.
@isaac: That is correct: You cannot create a partition and create entities in that partition within the same transaction. The same is true for attributes: You cannot create an attribute and use it in the same transaction.
@stuartsierra: Yeah, thanks. I separated it into two transaction.
I'm trying to install Datomic Pro Starter Edition on Windows 10 - I can't run bin/maven-install
because there is no .cmd
file equivalent. What gives?
I'm trying to store a JSON blob as :db.type/bytes
but I get this error
ERROR java.lang.IllegalArgumentException: :db.error/wrong-type-for-attribute Value {:href "", :method "POST", :title "corge (Phrase)"} is not a valid :bytes for attribute :action/form
Any suggestions? Also is bytes even the right type?What are the requirements for something to be storable as bytes?
The Datomic "Getting Started" isn't giving me any warm fuzzies - more like I feel like an idiot. Just FYI.
hey @currentoor a json blob should be put into a :db.type/string
@jonahbenton: i plan on storing error information that could be on the order of a megabyte in size. Is that ok?
@currentoor my understanding is that current design considerations around datom storage are in the vein of a max of low 10s of k for strings. so writing and retrieving blobs closer to a MB in size is considered "suboptimal" for some definition of suboptimal. whether it's ok probably depends on your use case, throughput requirements, etc.
@meow: bin/maven-install
is only needed if you're going to use the Datomic Peer libraries with Java or Clojure tools that use Maven for dependency resolution, such as Maven or Leiningen.
bin/maven-install is a very simple script that just calls the Maven command-line executable.
I'm afraid I don't know exactly, but if you have Maven (http://maven.apache.org) installed you should be able to copy the mvn
command from bin/maven-install
.
Since I'm just starting with it and it isn't critical I'm putting it off for a few days. Not in the mood.
No offense, I appreciate the help. Just don't feel like I should need it just to install the thing.
@jonahbenton: thanks for the advice.
hey @meow hit me up when you want to come back to it, happy to help