norm
norm copied to clipboard
[Feature Request][Crazy Idea] Diagram/Documentation generation
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 ?
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.
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
Any ideas how this could be done?
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?
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.
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