Skip to content

Instantly share code, notes, and snippets.

@stuarthalloway
Created June 16, 2017 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuarthalloway/38f6341871b900846afbcfcccff06a03 to your computer and use it in GitHub Desktop.
Save stuarthalloway/38f6341871b900846afbcfcccff06a03 to your computer and use it in GitHub Desktop.
Java Transaction Function in Clojure
(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