Skip to content

Instantly share code, notes, and snippets.

Avatar

Caleb Macdonald Black CalebMacdonaldBlack

View GitHub Profile
@CalebMacdonaldBlack
CalebMacdonaldBlack / query_check.clj
Created Apr 11, 2018 — forked from maxweber/query_check.clj
Checks if a Datomic datalog query contains only allowed symbols / functions.
View query_check.clj
(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