norm icon indicating copy to clipboard operation
norm copied to clipboard

[Feature Request][Crazy Idea] Diagram/Documentation generation

Open Clonkk opened this issue 3 years ago • 6 comments

I had this crazy idea to improve Norm the other day...

What if using Models declaration we make a graph of the Tables and use it to generate a diagram of the database ? We can use an UML tool like Drawio (internal representation is XML) or a Nim alternative if there is one.

Do you think this would it be feasible ?

Clonkk avatar May 14 '21 14:05 Clonkk

I’m sure there are tools that can do that for a DB, so I don’t really think Norm would be necessary for it.

But if somehow no such tool exist (I’d be surprised), sure, it’s a great idea!

Another great idea is to generate GraphQL or Jester or Prologue boilerplate code from models.

moigagoo avatar May 14 '21 14:05 moigagoo

No idea if such tools exists but they would most likely require a running instance of the database and not source code. So you'd have to instantiate and populate a database to then generate schematics as opposed to just be able to generate the graph at compile time.

Anyway this was just something that popped into my mind

Clonkk avatar May 14 '21 15:05 Clonkk

Any ideas how this could be done?

moigagoo avatar May 14 '21 15:05 moigagoo

Either with a macro but then we'd have to handle the parsing of the AST and that ca' be tedious.

Otherwise (but I'm not sure if that's enough) during Table creation when the pragma are handed?

Clonkk avatar May 14 '21 16:05 Clonkk

I’m talking more about visualizing it.

As to analyzing models, we can analyze model instances instead of types which is a lot easier, covers initialization issues, and can be done without macros.

Get Outlook for iOShttps://aka.ms/o0ukef


From: Regis Caillaud @.> Sent: Friday, May 14, 2021 8:50:26 PM To: moigagoo/norm @.> Cc: Constantine Molchanov @.>; Comment @.> Subject: Re: [moigagoo/norm] [Feature Request][Crazy Idea] Diagram/Documentation generation (#113)

Either with a macro but then we'd have to handle the parsing of the AST and that ca' be tedious.

Otherwise (but I'm not sure if that's enough) during Table creation when the pragma are handed?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/moigagoo/norm/issues/113#issuecomment-841368836, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAH7GXBBPMNKFOCN5V6WYA3TNVIFFANCNFSM444QEMXA.

moigagoo avatar May 14 '21 16:05 moigagoo

Oh, my initial idea was to generate an XML file on the draw.io format (it's looks like UML) but that's only because I don't know if there are Nim alternative for graph plotting

Clonkk avatar May 14 '21 16:05 Clonkk