R
R
REDkiy2017-05-19 10:03:43
Python
REDkiy, 2017-05-19 10:03:43

How to dynamically create tables with SQLAlchemy?

Flask based application. I use SQLAlchemy to interact with the database. There is a group of application database tables that are hardcoded in the code. I use Flask-Migrate to create and migrate them. So far everything is more or less satisfactory.
It is necessary to dynamically create tables in the database and minimally work with them - create, delete. You also need a minimum of work with columns - add a column, delete a column.
It also doesn't need the table to be included in the shared migration created with Flask-Migrate.
I have a dynamically generated class that describes a future table, which is generated by a special function. What tool or method can be used to solve this problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question