This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # admin-announcements (1)
- # aleph (3)
- # beginners (20)
- # boot (9)
- # cider (74)
- # clara (1)
- # cljs-dev (28)
- # cljsrn (15)
- # clojars (32)
- # clojure (149)
- # clojure-dusseldorf (3)
- # clojure-italy (6)
- # clojure-nl (3)
- # clojure-russia (20)
- # clojure-uk (5)
- # clojurescript (133)
- # core-async (2)
- # cursive (19)
- # datomic (24)
- # devcards (1)
- # funcool (100)
- # hoplon (48)
- # keechma (1)
- # kosmos (7)
- # ldnclj (3)
- # leiningen (3)
- # luminus (16)
- # off-topic (8)
- # om (103)
- # onyx (47)
- # pedestal (3)
- # proton (7)
- # re-frame (13)
- # reagent (11)
- # ring-swagger (1)
- # specter (6)
- # testing (12)
- # untangled (24)
- # yada (32)
@wei - both ⛑ definitely planning on open sourcing our stuff as well, when the time is right.
would there be any issues with creating enum entities dynamically (i.e. to reflect user additions)? I want to provide a hierarchical tagging system and think they'd be more useful than raw strings.
The one issue I can think of is that I'd have to manage them indirectly to e.g. handle "deletions"
@curtosis: so for the first pass I’ll throw out the basic rule of thumb — if it’s something you’d type into your application code, that’s the best fit for an ident.
for most other cases having a unique identifier and using lookup refs is the best approach.
the point of ident is for its keyword name to be interchangeable in many contexts with its entity id. If you have to do partial matching on the stringified ident, or generate things on the fly, you’ll give up performance advantages that come from having the ident in memory.
Also, if I recall correctly, all Idents are kept in memory, all of the time, on all Peers. If your users create millions of tags, that could lead to inefficient use of memory.
That makes sense. I don't think I expect anywhere near that many tags, but there doesn't seem to be much cost to just avoiding it in the first place. And there's indeed something to be said about not exposing program-internal language to the user.
as I understand it, I don't even really need to create a uuid attribute - the string name has to be unique anyway for lookup refs to work, right? So there'd be an entity with one attribute, which would be a name instead of a db.ident, right?
right, in this case by “unique identifier” I meant to point towards a string (or potentially keyword) attribute with
:db/unique :db.unique/identity rather than suggest a uuid valued field.
for tags or something similar, unique string makes sense. Whether or not it makes sense to model it as an entity is a separate question, it looks like given the hierarchy of tags you expect, the entity with an attribute for a name and other attribute(s) for relations to other tags makes sense.
good, I'm following. :) And in fact I do have it modeled as an entity, precisely because I also want a
:tag/parent ref attribute.
rereading the page on identity and uniqueness, it's all laid out pretty nicely - the key bit here is that my "enumerated tags" usage is not programmatic, so the semantics should be different (as are the tradeoffs). got it, thanks!
When a peer upgrades its Datomic version, must the transactor that it connects to also be on the exact same version? If not, how do you know when to upgrade both the peer and transactor, as opposed to just the peer?
@sdegutis: don’t need to match versions except across compatibility breaking changes (all documented here: http://docs.datomic.com/release-notices.html ) — recommendations for upgrading an entire live system are here: http://docs.datomic.com/deployment.html#upgrading-live-system
how would you use
get-else where the non-default value is not the value that would be missing? This doesn't do it:
(d/q '[:find ?label ?parent :in $ :where [?t :tag/label ?label] [?t :tag/parent ?r] [(get-else $ ?r :tag/label "N/A") ?parent]] (d/db conn))
hmm... maybe get-else isn't the right tool here. I got it to do what I expect using an or-join, but it looks a little ugly:
[:find ?label ?parent :in $ :where [?t :tag/label ?llabel] (or-join [?label ?parent ?t] (and [(missing? $ ?t :tag/parent)] [(ground "N/A") ?parent]) (and [?t :tag/parent ?r] [?r :tag/label ?parent]))]