This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-22
Channels
- # announcements (7)
- # beginners (10)
- # biff (2)
- # calva (12)
- # clerk (1)
- # clojure-europe (1)
- # clojure-korea (2)
- # clojure-norway (6)
- # cursive (5)
- # datahike (10)
- # datalevin (6)
- # datascript (2)
- # fulcro (2)
- # honeysql (18)
- # kaocha (1)
- # missionary (2)
- # off-topic (6)
- # pedestal (3)
- # ring (2)
- # shadow-cljs (11)
- # sql (2)
- # xtdb (4)
Hi, I'm learning datalog and datascript. I tried to use example from https://github.com/kristianmandrup/datascript-tutorial/blob/master/pull_data.md When I try same query (in clojure project). I get error
(d/pull-many (d/db conn) '[*] (d/q '[:find ?e :where [?e]]
))
;; Error - Too few inputs passed, expected: [$], got: 0
When I pass db to inner query
(d/pull-many (d/db conn) '[*] (d/q '[:find ?e :where [?e]]
(d/db conn)))
;; Error - Lookup ref should contain 2 elements: [100]
which I think is happening as result set looks like #{[4] [5] [100]}
. If it change to vector and flatten (flatten (vec ids))
and pass it to pull-many then it works.
Is there a mistake in guide or am I missing something that will let me chain query to pull expression?👍 1