sqldelight icon indicating copy to clipboard operation
sqldelight copied to clipboard

Plugin: Add sql diagram

Open hfhbd opened this issue 2 years ago • 4 comments

Description

It would be very cool, if the plugin could show a database diagram, (tables, attributes, references).

hfhbd avatar Feb 18 '22 11:02 hfhbd

Seems like SchemaCrawler can do this for free so we should probably just use that

AlecKazakova avatar Apr 11 '22 16:04 AlecKazakova

Yeah, sounds good. Personally, I would like to see mermaid diagrams after Dokka and GitHub markdown support.

I would not expect this functionality in sqldelight core. And schema crawler supports a JSON export. So if you plan to include schema crawler, it would be nice, if it also saves the json output too for further processing.

hfhbd avatar Apr 11 '22 21:04 hfhbd

we already use schemacrawler in the gradle plugin to verify migrations which is why that was the route I was thinking. I think bundled in the SQLDelight IDE would be pretty sweet if its not a massive effort to maintain, but I don't feel strongly about it

AlecKazakova avatar Apr 11 '22 21:04 AlecKazakova

Ah nice. I will try to experiment with schema crawler and mermaid tomorrow. Maybe adding the diagram as kdoc comment to the generated DB file is sufficient. At least for me adding the diagram in the docs and publish them with dokka is enough.

hfhbd avatar Apr 11 '22 22:04 hfhbd