d2 icon indicating copy to clipboard operation
d2 copied to clipboard

d2plugin: Plugin for importing Postgres schema as CSV

Open alixander opened this issue 3 years ago • 4 comments

Can auto-create a SQL table diagram

alixander avatar Nov 07 '22 18:11 alixander

Can you elaborate on how this plugin would work? And why it'd be a plugin?

nhooyr avatar Nov 07 '22 23:11 nhooyr

yeah scratch the plugin part. maybe d2 convert my_schema.csv schema_diagram.d2?

alixander avatar Nov 08 '22 01:11 alixander

is there any indication within the .csv that it's a postgres schema? Perhaps we can automatically compile to svg.

like d2 my_schema.csv generates my_schema.svg

then to generate a .d2 file you do:

d2 --output-format=d2 my_schema.csv

Same method for handling .dot and .mmd files.

nhooyr avatar Nov 08 '22 02:11 nhooyr

This way D2 is a drop in compiler for .dot and .mmd.

nhooyr avatar Nov 08 '22 02:11 nhooyr