Skip to content

Instantly share code, notes, and snippets.

@benkamphaus
Created February 25, 2015 17:20
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 benkamphaus/e5e85def4c08afae4591 to your computer and use it in GitHub Desktop.
Save benkamphaus/e5e85def4c08afae4591 to your computer and use it in GitHub Desktop.
(require '[datomic.api :as d] 'clojure.pprint)
;; You can run this with bin/run in the $DATOMIC_DIR
(println "Printing database schema...")
(def conn (d/connect (first *command-line-args*))) ;; call with db-uri as arg
; Find and pretty-print each attribute in schema
(let [db (d/db conn)]
(clojure.pprint/pprint
(map #(->> % first (d/entity db) d/touch)
(d/q '[:find ?v
:where [_ :db.install/attribute ?v]]
db))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment