Created
July 8, 2022 13:30
-
-
Save athanhat/7aa53c54110cc3258ba52e00128a065c to your computer and use it in GitHub Desktop.
Hodur Visualize Datomic Schema with graphviz
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
(ns hodure-test.getting-started | |
(:require [hodur-engine.core :as hodur] | |
[hodur-datomic-schema.core :as hodur-datomic] | |
[hodur-graphviz-schema.core :as hodur-graphviz] | |
[clojure.java.io :as io] | |
)) | |
(def person-schema (hodur/init-schema | |
'[^{:datomic/tag-recursive true} | |
Person | |
[^String first-name | |
^String last-name]] | |
)) | |
(def employee-schema (-> "schemata/employee.edn" | |
io/resource | |
hodur/init-path)) | |
(comment | |
;; Generate Datomic schema: | |
(hodur-datomic/schema person-schema) | |
(hodur-datomic/schema employee-schema) | |
(spit "employee-schema.dot" | |
(hodur-graphviz/schema employee-schema {:groups ["person-group" "enum-group"]})) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment