Reputation: 31
Ok ok the table already exists....
Is there any utility to transform a mysql table into a flask-sqlalchemy db.Model without typing?
Upvotes: 1
Views: 2030
Reputation: 1790
yes, I personally like sqlacodegen
, see https://pypi.python.org/pypi/sqlacodegen
to install:
pip install sqlacodegen
to generate ORM code (using MySQL as an example, root user with no password):
sqlacodegen mysql+pymysql://root@localhost/your_database_name
Upvotes: 2