This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-25
Channels
- # announcements (5)
- # babashka (2)
- # beginners (36)
- # bristol-clojurians (3)
- # calva (26)
- # cider (11)
- # clj-kondo (26)
- # cljfx (5)
- # cljsrn (7)
- # clojure (149)
- # clojure-berlin (13)
- # clojure-czech (1)
- # clojure-dev (6)
- # clojure-europe (50)
- # clojure-france (2)
- # clojure-italy (9)
- # clojure-nl (4)
- # clojure-uk (48)
- # clojured (1)
- # clojuredesign-podcast (4)
- # clojurescript (27)
- # core-async (3)
- # cursive (5)
- # data-science (1)
- # datalog (1)
- # datomic (32)
- # emacs (8)
- # events (1)
- # fulcro (19)
- # graalvm (2)
- # graphql (7)
- # jobs (1)
- # malli (5)
- # meander (36)
- # nrepl (2)
- # parinfer (2)
- # pedestal (14)
- # reagent (4)
- # reitit (2)
- # reveal (7)
- # specter (4)
- # tools-deps (6)
- # uncomplicate (1)
- # vrac (2)
- # xtdb (12)
I didn't see anything stating the new version of REBL in dev-tools -- I had to download the ZIP to find out what the latest version was (0.9.242) so that I could put it in my deps.edn
and pull it from the Cognitect Maven repo.
(and, yes, I know that having downloaded the ZIP, I don't need to set it up that way -- I could just use a local install -- but I prefer the idea of being able to get things direct from Maven)
Hey! I want to pull all data on an entity based on it's entity id, can anyone tell me what's wrong with this query? (d/pull (d/db conn) [:db/id 79164837199970])
I know the id based on a previous query
missing colon on :db/id
Ah, had that messed up. This isn't working for me either, it just says
Execution error (NullPointerException) at com.google.common.base.Preconditions/checkNotNull (Preconditions.java:782).
null
(d/pull (d/db conn) [:db/id 79164837199970])
like so? (d/pull (d/db conn) 79164837199970)
Ah, right, that’s true
I guess there's something wrong with the query I'm getting this id from then, I'm still getting null pointer exceptions
funny, though, why wouldn’t that work just like any other unique ID pair?
@UNMBR6ATT Are you sure you haven’t lost the conn
? That could give you an NPE
@U2J4FRT2T Ok, that makes sense
I guess I’ll aways be an old SQL guy at heart
I don't think so, I can still run a query that gives me [[79164837199970]]
and all of my functions are making a fresh (d/db conn)
the query that gives me the id is
[:find ?e :where [?e :user/email ?email]]
which, if I'm not mistaken, should just give me the entity ids of anything with an email address
you don’t have a selector, you’d need (d/pull (d/db conn) '[*] id)
to pull everything for id.
thank you, that did it!
Yeah that was it, I was looking up the docs:
datomic.api/pull
([db pattern eid])
Returns a hierarchical selection of attributes for eid.
See for more information.
I was just working with pull expressions too, should have spotted that sooner.
Sorry for the silly question, these docs have a lot of "..." that really throws me off. I'm curious why I didn't get an arity exception though
Yeah, seems like you should have.
Oh, I guess I could have included the selector and :eid all in a map. All makes sense now. Thanks everyone!