Clojure Datomic:Can';t从REPL计算d/transaction
我是Datomic on-prem的新手,但我无法从我的编辑处调用d/transact 我启动了对等服务器和事务处理程序Clojure Datomic:Can';t从REPL计算d/transaction,clojure,datomic,Clojure,Datomic,我是Datomic on-prem的新手,但我无法从我的编辑处调用d/transact 我启动了对等服务器和事务处理程序 bin/run -m datomic.peer-server -h localhost -p 8998 -a myaccesskey,mysecret -d pensine,datomic:dev://localhost:4334/pensine 我已经把它写在我的缓冲区里了 (def cfg {:server-type :peer-server :a
bin/run -m datomic.peer-server -h localhost -p 8998 -a myaccesskey,mysecret -d pensine,datomic:dev://localhost:4334/pensine
我已经把它写在我的缓冲区里了
(def cfg {:server-type :peer-server
:access-key "myaccesskey"
:secret "mysecret"
:endpoint "localhost:8998"})
(def client (d/client cfg))
(def conn (d/connect client {:db-name "datomic:dev://localhost:4334/pensine"}))
// Loaded everything above in the REPL then tried to evaluate the expression below.
(d/transact conn {:tx-data [{:db/ident :red}]}) // this throw the error below
@(d/transact conn {:tx-data [{:db/ident :red}]}) // this throw the error below
答复:
Execution error (IllegalArgumentException) at datomic.client.api.protocols/fn$G (protocols.clj:72).
No implementation of method: :transact of protocol: #'datomic.client.api.protocols/Connection found for class: clojure.lang.Var$Unbound
在我的dev-In-memory设置中,我使用参数启动对等服务器
-d pensine,datomic:mem://pensine
并使用
(def conn (d/connect client {:db-name "pensine"}))
在此设置中,您不需要事务处理程序
希望有帮助,我还没有做过更全面的设置
(def conn (d/connect client {:db-name "pensine"}))