This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-11
Channels
- # aleph (3)
- # announcements (3)
- # aws (7)
- # babashka (121)
- # beginners (82)
- # calva (40)
- # chlorine-clover (37)
- # clj-kondo (68)
- # cljsrn (4)
- # clojure (43)
- # clojure-australia (1)
- # clojure-dev (6)
- # clojure-europe (15)
- # clojure-italy (2)
- # clojure-nl (1)
- # clojure-provo (3)
- # clojure-spec (23)
- # clojure-taiwan (1)
- # clojure-uk (21)
- # clojurescript (214)
- # code-reviews (1)
- # conjure (4)
- # core-async (10)
- # cursive (52)
- # datahike (5)
- # datascript (5)
- # datomic (62)
- # duct (1)
- # emacs (4)
- # fulcro (8)
- # graalvm (1)
- # helix (1)
- # honeysql (5)
- # integrant (1)
- # jackdaw (32)
- # jobs (3)
- # jobs-discuss (16)
- # juxt (1)
- # kaocha (3)
- # lsp (6)
- # malli (2)
- # meander (6)
- # nrepl (1)
- # off-topic (46)
- # other-languages (4)
- # pathom (7)
- # polylith (13)
- # re-frame (3)
- # releases (2)
- # shadow-cljs (56)
- # spacemacs (15)
- # tools-deps (3)
- # unrepl (1)
- # utah-clojurians (1)
Hello I am new to datascript and I explore Athens codebase that uses it.
Playing with datascript.core/datoms
I get an error with the :avet
index:
#error {:message "Attribute :block/string should be marked as :db/index true", :data {:error :index-access, :index :avet, :components [:block/string]}}
Where should I declare this :db/index true
?
here is my lookup (d/datoms @dsdb :avet :block/string)
I tried to edit the schema here without much success
https://github.com/athensresearch/athens/blob/main/src/cljs/athens/db.cljs#L126-L134
my new schema looks like this with :block/string
added
@@ -131,7 +130,8 @@
:block/children {:db/cardinality :db.cardinality/many
:db/valueType :db.type/ref}
:block/refs {:db/cardinality :db.cardinality/many
- :db/valueType :db.type/ref}})
+ :db/valueType :db.type/ref}
+ :block/string {:db/index true}})
@UC0JV84JF without looking at the doc's that seems reasonable, are you still getting the error?
yes, but I think it has something to do with the way the db is created on Athens side.
Because in the REPL I can see the index when I do (d/empty-db schema)
But the index is notthere when I inspect the schema for the datascript db that is defined here https://github.com/athensresearch/athens/blob/main/src/cljs/athens/db.cljs#L137
It must be reset somewhere else. I need to dig more.