Auto Generate sqlachemy models from yml file or dicts
87 views
Skip to first unread message
David Boateng Adams
unread,
Jul 3, 2022, 9:15:03 AM7/3/22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sqlalchemy
I want to be able to auto generate sqlalchemy model from a schema. So I have the schema in yaml format. From that file, I load it and get the columns and its data type and also the schema name into a dict. And I want to use that dictionary to create the sqlalchemy model not just a normal python class
I have done some research and I see you can use sqlachemy's automap feature to do what I want but that is when you supply a DB connection uri. Likewise sqlacodegen
Val Huber
unread,
Jul 3, 2022, 8:11:36 PM7/3/22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sqlalchemy
Hi, David...
ApiLogicServer bundles a version of sqlacodegen, and creates the models.py file (along with a running project). Don't know if this fits your needs, hope it helps.