This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-23
Channels
- # aws (2)
- # beginners (57)
- # boot (63)
- # cider (7)
- # clara (1)
- # cljs-dev (1)
- # cljsrn (5)
- # clojure (68)
- # clojure-brasil (1)
- # clojure-dusseldorf (2)
- # clojure-greece (10)
- # clojure-italy (29)
- # clojure-russia (1)
- # clojure-spec (9)
- # clojure-uk (66)
- # clojurescript (16)
- # cursive (18)
- # datomic (19)
- # docker (3)
- # figwheel (2)
- # fulcro (61)
- # instaparse (7)
- # jobs (1)
- # luminus (5)
- # lumo (47)
- # mount (6)
- # off-topic (13)
- # onyx (39)
- # planck (4)
- # portkey (2)
- # re-frame (28)
- # ring (6)
- # ring-swagger (30)
- # rum (3)
- # shadow-cljs (142)
- # spacemacs (5)
- # sql (2)
- # unrepl (61)
- # untangled (2)
Do you guys think it's okay to expose eid to client as part of a url?
No, consider them internal
so, it is better to have some uuid or int id which can be exposed?
yes. lookup refs can be used everywhere an eid can, e.g. [:person/id #uuid "asdf-asdf-asdf-asdf"]
may I ask why it's not okay? i'm building an http service and returning them to the service's client, just curious idk, i might be doing something wrong xD
They are not guaranteed to be unchanging. So there should be no long-lived weakly-referenced entity ids in your system (eg in a url, or in a json blob stored somewhere). In your example, your urls night break one day.
eid haven't changed in practice so this may not be important practically speaking
but remember that if you re-create a database in some way other than restoring (i.e. re-inserting datoms), you won't have control over eids
yeah, that's what i noticed reading the docs on Identity and Uniqueness, thanks for confirming
it works just like an identity column in a relational database configured auto increment
@U06F82LES what will happen if you use [:person/id #uuid "....."]
and the string is not a valid UUID?
my argument for using strings for UUID types has been that I don't want to manually convert to an UUID object and have to catch the exception that java throws if it's invalid and return a 404 instead of a 500 in my web servers
@U0MKRS1FX you'll get a reader exception
but yeah you'd have to catch the exception manually I think if you care
may I ask why it's not okay? i'm building an http service and returning them to the service's client, just curious idk, i might be doing something wrong xD