Skip to content

Instantly share code, notes, and snippets.

View oakes's full-sized avatar

Zach Oakes oakes

View GitHub Profile
@maxweber
maxweber / query_check.clj
Created May 13, 2016 16:41
Checks if a Datomic datalog query contains only allowed symbols / functions.
(require '[datomic.api :as d]
'[clojure.string :as str])
(defn normalize-query
"Turns a vector formatted Datomic datalog query into a map formatted
one."
[query]
(let [pairs (partition-by keyword? query)]
(assert (even? (count pairs)))
(into