I understand that there is a db migration process to create databases/tables using SQL-Alchemy. But I am looking for the reverse. DBAs will create and manage Data definitions and they don't want to manage it through python code. So assuming that model, if an existing database schema (in postgresql) is defined how can I create the data model for that schema in SQL Alchemy (without actually typing out every class)? Is there a reverse engineering tool that people recommend to accomplish this task?
I've tried sqlacodegen 1.1.5 but it doesn't seem to produce the right python files for foreign key relationships in tables.
Any suggestions will be greatly appreciated.
I used sqlacodegen 1.1.6: https://pypi.python.org/pypi/sqlacodegen.
It works, generates the python script with all classes, and relationship tables for many to many relationship.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With