This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-08-03
Channels
- # bangalore-clj (1)
- # beginners (104)
- # boot (30)
- # braveandtrue (1)
- # cider (6)
- # cljs-dev (95)
- # cljsjs (16)
- # cljsrn (3)
- # clojure (106)
- # clojure-italy (15)
- # clojure-nl (2)
- # clojure-norway (3)
- # clojure-russia (1)
- # clojure-spec (40)
- # clojure-uk (53)
- # clojure-ukraine (1)
- # clojurescript (200)
- # code-reviews (2)
- # cursive (1)
- # datascript (3)
- # datomic (32)
- # editors (28)
- # gorilla (6)
- # graphql (8)
- # hoplon (1)
- # jobs (8)
- # jobs-discuss (5)
- # jobs-rus (1)
- # keechma (13)
- # leiningen (5)
- # luminus (3)
- # lumo (53)
- # off-topic (5)
- # om (5)
- # om-next (1)
- # onyx (56)
- # parinfer (7)
- # protorepl (22)
- # re-frame (47)
- # reagent (37)
- # remote-jobs (1)
- # ring-swagger (9)
- # specter (7)
- # vim (14)
- # yada (30)
what's an example of when you'd want to use a :db.unique/value
instead of a :db.unique/identity
?
"Unique values have the same semantics as unique identities, with one critical difference: Attempts to assert a new tempid with a unique value already in the database will cause an IllegalStateException."
new question: if you d/delete-database
a db with underlying sql storage, does it drop the associated rows in sql?
if you had an entity that was totally immutable (never updated)
then you wouldn’t want to upsert it, devth
that’s probably fair
i would say unless you know you’re going to upsert, just use value, schema change allows those attributes to change later anyways
say I want to add a derived field to a reference, and there are many of this type in the system (memory large). Let’s call the ref a location, cause that happens to be what I’m updating currently. In a transaction function, I could query all locations and then map over and return the new datom for each. If I didn’t want to pull all results in to memory at once, what would i do? Also, if I do this within a transaction function the size of the returned transaction would be enormous. I should probably fix that as well, no?
I should probably do this outside of a transaction function, and use d/datoms, shouldn’t i?
are you trying to compute some extra attribute+value on an entity based on input from a query, and do it in bulk across a bunch of entities?
I’m just adding a new attribute to an entity in the system, and there are a lot of entities I need to update. For each new attribute is a projection of many existing attribute on said entity. I think the answer to your last question is, yes. @favila
my guess is I should use d/datoms
to iterate over all the entities and then tx-pipeline them in