felixflores / datomic_schema_grapher

Create a Graphviz graph of your diatomic schema.
Eclipse Public License 1.0
56 stars 10 forks source link

Enums are not modelled correctly in diagram #2

Open roanosullivan opened 10 years ago

roanosullivan commented 10 years ago

Thank you for this project. As I get acclimated to Datomic, it's been extremely helpful to visualize my attribute namespaces in terms of the more familiar ER conventions.

The Problem

It's possible I'm not understanding the diagram correctly since I'm working with Datomic for the first time, but it appears to me that Enums are not modelled correctly.

In the diagram snippet at the bottom of this description, why does the "dataType:ref" attribute point to "db" and not to a "field.dataType" object?

Steps to Reproduce

   {:db/id #db/id[:db.part/db]
    :db/ident :field/dataType
    :db/valueType :db.type/ref
    :db/cardinality :db.cardinality/one
    :db/fulltext false
    :db/doc "Refers to one of the :field.dataType/* values."
    :db.install/_attribute :db.part/db}

   ;; text, text_multiLine, number, date, bool, lookup, complex
   [:db/add #db/id[:db.part/user] :db/ident :field.dataType/text]
   [:db/add #db/id[:db.part/user] :db/ident :field.dataType/textMultiLine]
   [:db/add #db/id[:db.part/user] :db/ident :field.dataType/number]
   [:db/add #db/id[:db.part/user] :db/ident :field.dataType/date]
   [:db/add #db/id[:db.part/user] :db/ident :field.dataType/boolean]
   [:db/add #db/id[:db.part/user] :db/ident :field.dataType/lookup]
   [:db/add #db/id[:db.part/user] :db/ident :field.dataType/complex]
#!/bin/bash
lein exec -pe "(require '[datomic-schema-grapher.core :refer (graph-datomic)])(graph-datomic \"datomic:dev://localhost:4334/mydb\" :save-as \"docs/mydb-schema.dot\" :no-display true :exit-on-close true)(System/exit 1)"
/usr/local/Cellar/graphviz/2.38.0/bin/dot -Tpng docs/mydb-schema.dot > docs/mydb-schema.png
open docs/mydb-schema.png

datomic_schema_grapher_issue_snippet

pkimbrel commented 7 years ago

+1 I am also getting this issue.

pkimbrel commented 7 years ago

I think the issue is enums do not get installed in :db/attribute - I wonder if it could be assumed that a reference to an item not in the attribute table is assumed to be enum?