tortoise / tortoise-orm

Familiar asyncio ORM for python, built with relations in mind
https://tortoise.github.io
Apache License 2.0
4.62k stars 383 forks source link

Automatic data modelling from ORM #1230

Open caniko opened 2 years ago

caniko commented 2 years ago

A way to generate data models diagrams from tortoise model hierarchies. UML makes most sense considering it is a language.

caniko commented 2 years ago

I can see an avenue from tortoise/orm_mode -> pydantic -> py2puml. Where most of the code is either on pydantic, or on an addon integrating pydantic -> py2puml; the same addon could integrate tortoise or orm_mode to the chain as an extra.

I am not sure what needs to happen, I found this issue on the py2uml side.

@samuelcolvin probably has the best insight to this idea, or if it is feasible to begin with, Pydantic v2 is going to have some breaking changes that might break the entire chain; maybe worth waiting for.

I think this is worth looking into, not sure if any other Python ORM, or any ORM, has this kind of feature! Please correct me if I am wrong, I need this :sweat_smile: