This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-29
Channels
- # announcements (1)
- # babashka (83)
- # beginners (67)
- # chlorine-clover (22)
- # cider (11)
- # circleci (6)
- # clj-kondo (12)
- # cljs-dev (137)
- # cljsrn (15)
- # clojure (124)
- # clojure-europe (40)
- # clojure-italy (1)
- # clojure-nl (3)
- # clojure-norway (1)
- # clojure-serbia (3)
- # clojure-spec (19)
- # clojure-uk (14)
- # clojuredesign-podcast (5)
- # clojurescript (80)
- # conjure (49)
- # core-async (62)
- # cursive (18)
- # datascript (1)
- # datomic (64)
- # docker (28)
- # emacs (20)
- # figwheel-main (249)
- # fulcro (95)
- # graalvm (2)
- # jobs-discuss (11)
- # joker (2)
- # juxt (4)
- # lambdaisland (9)
- # leiningen (1)
- # meander (14)
- # mount (6)
- # off-topic (16)
- # pathom (46)
- # re-frame (35)
- # reagent (6)
- # reitit (5)
- # shadow-cljs (28)
- # spacemacs (6)
- # sql (18)
- # tools-deps (26)
- # vim (8)
- # xtdb (23)
- # yada (1)
Getting a seemingly bizarre problem with Datascript. For some reason when I run this query without it being wrapped in a function, everything works. But once I wrap it in a function, it returns the value for :block/content
for every entity in the database. I'm confused because I haven't encountered any issues with wrapping other Datascript queries in the past. Does anyone more experienced than me with Datascript see any issues?
;; Works fine and returns the correct value
(ds/q '[:find ?block-text
:where
[?id :block/id "l_63xa4m1"]
[?id :block/content ?block-text]]
@conn)
;; Returns every value for `:block/content` in the db
(defn content-find
[id-passed]
(ds/q '[:find ?block-text
:where
[?id :block/id ?id-passed]
[?id :block/content ?block-text]]
@conn))
(content-find "l_63xa4m1")