This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-27
Channels
- # announcements (4)
- # beginners (41)
- # biff (8)
- # cider (14)
- # clj-kondo (5)
- # clojure (45)
- # clojure-brasil (1)
- # clojure-europe (20)
- # clojure-nl (1)
- # clojure-norway (30)
- # clojure-uk (10)
- # clojurescript (8)
- # cursive (25)
- # datomic (20)
- # emacs (11)
- # events (1)
- # hoplon (9)
- # humbleui (7)
- # hyperfiddle (6)
- # lsp (63)
- # matrix (1)
- # observability (20)
- # off-topic (36)
- # polylith (11)
- # re-frame (2)
- # releases (1)
- # rewrite-clj (6)
- # scittle (42)
- # sql (6)
- # squint (86)
- # tools-deps (9)
I don't think submit-tx actually waits for transactions
(defn submit-tx [{:keys [biff.xtdb/retry biff.xtdb/node]
:or {retry true}
:as ctx} biff-tx]
(if retry
(submit-with-retries ctx #(biff-tx->xt % biff-tx))
(xt/submit-tx node (-> (assoc-db ctx)
(assoc :biff/now (java.util.Date.))
(biff-tx->xt biff-tx)))))
it does by default--it won't if you set :biff.xtdb/retry to false (naming is hard π)
note that to see the result of a transaction you'll need to call xt/db to get a new db value
Biff also provides a higher-level wrapper over xtdb.api/submit-tx. It lets you specify document types from your schema. If the document you're trying to write doesn't match its respective schema, the transaction will fail. In addition, Biff will call xt/await-tx on the result, so you can read your writes.
Does anyone here do end-to-end testing of their biff apps? Iβm very interested to hear how you go about this π€
..."testing"? what's "testing"?