This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-18
Channels
- # beginners (17)
- # calva (1)
- # clara (1)
- # cljs-dev (12)
- # clojure (151)
- # clojure-france (11)
- # clojure-uk (6)
- # conjure (4)
- # datomic (32)
- # duct (42)
- # emacs (2)
- # fulcro (20)
- # lambdaisland (4)
- # malli (5)
- # meander (32)
- # pathom (8)
- # reagent (1)
- # reitit (7)
- # shadow-cljs (2)
- # sql (6)
- # tools-deps (2)
- # vim (17)
- # xtdb (1)
Along those lines, and this may be more of a beginner Clojure question than a Crux question, how would I evaluate and run one of the functions stored as a transaction? A crux query for the function returns a chunked seq. How would I go about evaluating that as a fn so I can run it? My idea was if I can't get info about the failed transaction, I can do a (if-not (crux/tx-committed? conn tx)) (log/error (manually-run-validations ,,,))
.
The list I'm getting from querying for the function is below. I'm trying to figure out how to turn it into a callable.
(clojure.core/fn
[com.owoga.template.dev/ctx com.owoga.template.dev/user]
(clojure.spec.alpha/valid?
:com.owoga.template.dev/user+db
(clojure.core/merge
com.owoga.template.dev/user
{:db com.owoga.template.dev/ctx})))
edit: Ah yes. Same reason the second form below fails.
(eval `(+ 2 2))
(eval `(defn foo [] (+ 2 2)))
Because qualifies with namespaces. And an
fn` form can't take com.owoga.template.dev/ctx
as a valid argument form. It needs just ctx
I see.👍 3