Skip to content

Instantly share code, notes, and snippets.

@michaelsbradleyjr
Created August 24, 2012 21:36
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save michaelsbradleyjr/3455905 to your computer and use it in GitHub Desktop.
defcrudo macro
(defmacro defcrudo
[name & forms]
(let [forms (if (vector? (first forms))
(list forms)
forms)]
`(defn ~name
~@(map (fn [form]
(let [args (first form)]
`(~args (oc/with-db
(apply og/open-graph-db! orient-rconn-info)
(oc/with-tx
~@(rest form))))))
forms))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment