mermerd icon indicating copy to clipboard operation
mermerd copied to clipboard

Add support for postgres enums

Open Zhurik opened this issue 3 years ago • 2 comments

We have a lot of enums in our production database, so I want to show them in ERD diagram. Right now they appear simply as USER-DEFINED. How do you look at fetching data about enums from DB and fitting those values into the comment section of describing tables (here) How it works right now:

erDiagram
  table_name {
          USER-DEFINED best_column
  }

How I propose it to look like:

erDiagram
  table_name {
          myFavouriteEnumType best_column "MyFavouriteEnumVal1, MyFavouriteEnumVal2, MyFavouriteEnumVal3"
  }

If you're okey with this proposal I can make PR later

Zhurik avatar Jul 29 '22 08:07 Zhurik

I have a similar idea in mind, but have not started implementing it yet. It should play well with the existing feature to display the constraint name in the column and should be an opt-in.

I have it on my personal todo list, but if you like to make a suggestion feel free to create a PR :)

KarnerTh avatar Aug 01 '22 17:08 KarnerTh

I created PR for this https://github.com/KarnerTh/mermerd/pull/17 Yes, it does not hoave proper tests for it, because it needs separate sql for creating some columns in Postgres db

Zhurik avatar Aug 03 '22 15:08 Zhurik

Feature will be released with version 0.5.0

KarnerTh avatar Nov 30 '22 19:11 KarnerTh