Created
June 16, 2017 13:48
-
-
Save stuarthalloway/38f6341871b900846afbcfcccff06a03 to your computer and use it in GitHub Desktop.
Java Transaction Function in Clojure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[datomic.api :as d]) | |
(def uri "datomic:mem://foo") | |
(d/create-database uri) | |
(def conn (d/connect uri)) | |
(def schema [{:db/ident :foo | |
:db/fn #db/fn | |
{:lang "java" | |
:params [db a b c] | |
:code "return a;"}}]) | |
(d/transact conn schema) | |
(d/invoke (d/db conn) :foo 1 2 3 4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment