chop-dbhi / data-models-sqlalchemy

SQLAlchemy models and DDL and ERD generation from chop-dbhi/data-models style JSON endpoints.
Other
11 stars 3 forks source link

Dynamically created tables are "Classical" SQLAlchemy style unmapped #22

Open gracebrownecodes opened 9 years ago

gracebrownecodes commented 9 years ago

See reference on SQLAlchemy mapping styles here. I made the switch from constructing class contents dictionaries and then using type to create the class (in "Declarative" style) to creating a "Classical" model class and building it up modularly a while ago, without realizing the difference. There is no problem with this, but I believe it might be confusing for beginning SQLAlchemy users, and would be easy to use the mapping API to create mapped model classes dynamically from the classical ones.

gracebrownecodes commented 8 years ago

It seems that the mapping API is actually quite difficult. It turns out the Declarative style might be the way to go.