First I started asking for this enhancement here: https://github.com/amberframework/granite-orm/issues/119
It would be very helpful in Amber to connect to a database to build a whole scaffolding.
It could be work like this:
amber inspectdb
and it will print the content of models file.
Use amber inspectdb Author Book to only have the table Author and Book.
It would be interesting to also give the specific database you want to use (development, production, etc.).
I found this kind of functionnality here: https://docs.djangoproject.com/en/2.0/ref/django-admin/#inspectdb
Believe me, it's very very very helpful! For any database I want to generate a graph, I create a django project, inspect the database, then use graph_model command to generate a PNG ^_^.
In fact, with this inspectdb command you can start quickly on any project (that doesn't use Amber) and be productive with Amber by creating a website or just an admin interface.
Is there any progress? If no one has started yet, I will try it. Because I need this ASAP. 馃槃
You can try this but its not perfect. It just tries to run scaffolding on all the fields. It generates duplicate timestamps and id's need some adjusting. https://github.com/drujensen/db_scaffold
@drujensen
Wow, great work! You prevented me from wasting time. Thank you! 馃樅
Interesting idea, I can see how that would be helpful. I think that might be good to nest under the db subcommand: amber db inspect
@drujensen do you think we can have your shard built into amber and have a amber db scaffold command?
@eliasjpr yes, I will take a stab at it when I get a chance.
Decided against providing this in Amber. you can use my shard to kickstart an existing project from a database.
Most helpful comment
Interesting idea, I can see how that would be helpful. I think that might be good to nest under the
dbsubcommand:amber db inspect