This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-19
Channels
- # announcements (6)
- # aws (10)
- # beginners (73)
- # bristol-clojurians (2)
- # calva (9)
- # cider (25)
- # clj-kondo (7)
- # clojure (160)
- # clojure-dev (2)
- # clojure-europe (63)
- # clojure-italy (7)
- # clojure-nl (10)
- # clojure-uk (76)
- # clojuredesign-podcast (6)
- # clojurescript (63)
- # cursive (6)
- # data-science (3)
- # datomic (26)
- # duct (59)
- # emacs (1)
- # fulcro (12)
- # graalvm (17)
- # hoplon (23)
- # jobs-discuss (2)
- # kaocha (6)
- # meander (7)
- # off-topic (3)
- # pathom (2)
- # rdf (68)
- # re-frame (12)
- # reagent (20)
- # reitit (5)
- # ring (3)
- # ring-swagger (1)
- # shadow-cljs (14)
- # spacemacs (10)
- # sql (3)
- # tools-deps (30)
- # yada (9)
Hi, is there a simpler way to solve this.
(d/q '[:find (pull ?fid [*])
:in $ ?email ?follow-id ?follower-email
:where
[?uid :user/email ?email]
[?uid :user/following ?follow-id]
[?fid :user/email ?follower-email]]
(d/db conn)
""
[:user/email ""]
"")
So I have a user-id and a follower-id, I want to fetch all information of the follower if the user is following
I managed to simplify down to this function
(defn get-follower
"Fetch all the User followers information"
[db user-email follower-email]
(->> (d/q '[:find (pull ?follow-id [*])
:in $ ?email ?follow-id
:where
[?uid :user/email ?email]
[?uid :user/following ?follow-id]]
db
user-email
[:user/email follower-email])
ffirst))
Please disregard this post đ
Is there some place that helps me decide on which storage engine I should use for Datomic?
Yes. Here is a comprehensive documentation https://docs.datomic.com/on-prem/storage.html
This tells me the how, not really the why I should decide for a particular one. I guess PostgreSQL is the "standard"? And, will Cassandra give me more performance, or PostgreSQL?
datomic uses storage as a generic key-value store, with only a few keys needing atomic updates
the particulars of the storage systems installs themselves are going to dominate more than which technology you use
It would be on premise for us, we're a startup and it is the best for us to keep the data on our own servers. Okay, so there isn't any particular difference as far as performance goes, good to know. Thanks!
(that said, we'll have to look how we proceed after a year with this new product of ours. Over $400/month for on-premise is a hefty price tag for a startup)
@favila Is there a way to pass pattern as an argument, to determind what items you want to fetch
(defn fetch-articles-by-tags
[conn tags pattern]
(d/q '[:find (pull ?aid ?pattern)
:in $ ?tags ?pattern
:where
[?aid :article/tagList ?tags]]
(d/db conn)
tags
pattern))
this code for example does not work
(defn fetch-articles-by-tags
[conn tags pattern]
(d/q '[:find (pull ?aid pattern)
:in $ ?tags pattern
:where
[?aid :article/tagList ?tags]]
(d/db conn)
tags
pattern))
Why didnt mine work, does adding ? make a huge difference?
You are the best đ
this is a special-case. by omitting ? you are signaling that this is not a binding; then it inlines that into the pull
this wasnât even supported in the beginning--this feature got added at some point without my noticing
Right, definitely a gotcha for someone learning this technology