This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-02
Channels
- # adventofcode (153)
- # announcements (29)
- # architecture (6)
- # babashka (5)
- # beginners (197)
- # calva (71)
- # clj-kondo (27)
- # cljfx (4)
- # cljs-dev (33)
- # cljsrn (1)
- # clojure (52)
- # clojure-australia (5)
- # clojure-boston (1)
- # clojure-europe (38)
- # clojure-france (1)
- # clojure-hungary (5)
- # clojure-italy (1)
- # clojure-nl (19)
- # clojure-uk (5)
- # clojurescript (12)
- # conjure (4)
- # core-async (3)
- # cursive (22)
- # datalog (70)
- # datomic (32)
- # deps-new (8)
- # emacs (79)
- # events (2)
- # fulcro (15)
- # graalvm (15)
- # leiningen (2)
- # lsp (5)
- # minecraft (1)
- # nbb (1)
- # off-topic (37)
- # polylith (11)
- # re-frame (9)
- # reagent (1)
- # reitit (3)
- # releases (1)
- # reveal (2)
- # shadow-cljs (42)
- # spacemacs (1)
- # tools-build (4)
- # tools-deps (55)
- # vim (11)
- # xtdb (6)
I have stood up a stand-alone xtdb app using fulcro. When I insert new documents into the database, then fetch those documents using the built in netty http service, I see errors about the document not existing. In the fulcro app I see the document in full, but from the http api web console I see an error. Also notice the transaction time for me is a day in the past, even though I deleted all files from disk and inserted that document at the same time as the valid time. I'm wondering what I'm doing wrong?
You might be running into some desync issues with the db atom in your state. https://github.com/roterski/fulcro-rad-xtdb/blob/main/src/main/roterski/fulcro/rad/database_adapters/xtdb/wrap_xtdb_save.clj#L148 Just a guess though. Not a high degree of confidence that this is your issue.
I didn't understand how to use the times in the query, and that they are sticky in the web console. I have it working perfectly now so I can read-only query into the documents created from the app. Really excellent system so far. I look forward to learning more xtdb.
@UAB2NMK25 the fulcro-rad-xtdb plugin uses a https://docs.xtdb.com/language-reference/datalog-transactions/#transaction-functions named ::delta-update
to perform writes. That means delta-update needs to be present in the db as a separate entity. If you follow https://github.com/fulcrologic/fulcro-rad-demo/blob/develop/src/xtdb/com/example/components/xtdb.clj#L9 and use start-databases
then https://github.com/roterski/fulcro-rad-xtdb/blob/main/src/main/roterski/fulcro/rad/database_adapters/xtdb/start_databases.clj#L27-L28 this transaction function as a part of the initialisation process but it looks like you’re missing it so I’m not sure if you’re calling this start-databases
or you’re starting the xtdb node manually somewhere else - that’s would be fine but you’d need to insert this transaction function manually as well to use the plugin’s writes.
UPDATE: I reread your problem and now I get that it was about querying for that function from the web console, so my answer is not very relevant. 😅 sorry for the confusion