Skip to content

Instantly share code, notes, and snippets.

@athanhat
Created July 8, 2022 13:30
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 athanhat/7aa53c54110cc3258ba52e00128a065c to your computer and use it in GitHub Desktop.
Save athanhat/7aa53c54110cc3258ba52e00128a065c to your computer and use it in GitHub Desktop.
Hodur Visualize Datomic Schema with graphviz
(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