Created
February 25, 2015 17:20
-
-
Save benkamphaus/e5e85def4c08afae4591 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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