Is there any database model constructor that can output SQLAlchemy models?

I am implementing a database model for storing 20+ fields in the iCal calendar format, and I am faced with the tedious input of all this data into the model.py SQLAlchemy file. Is there a more reasonable approach? I am looking for a GUI or model designer who can create a model.py file for me. I would indicate column names and some attributes, such as type, length, etc.

At a minimum, I need this constructor to output the model for a single table. Additional requirements in descending order of priority:

  • Create multiple tables
  • Support for basic relationships between multiple tables (1: 1, 1: n)
  • Support restrictions for columns.

I am also open to other ways to achieve my goal, perhaps using a graphical interface to create tables in the database and then mirror them back into the model.

I appreciate your feedback in advance.

+3
source share
3 answers

Another way to create a SQLAlchemy model. You can use Vertabelo, an online tool for visual database design. It is completely free for small projects.

After creating your model in Vertabelo, you will have to convert it to SQLAlchemy mapping classes using the script available on GitHub .

Just follow these steps:

  • XML ( XML )

  • SQLAlchemy

./vertabelo_sqlalchemy.py -i your_diagram.xml -o model.py

, , , .

+2

" , , .."

,

" model.py SQLAlchemy"?

, , .

+1

workbench_alchemy a script MySQL .

I haven’t used it a lot, but so far it looks great! Easy to install. There is a possibility to make a conclusion compatible with SQlite. The script log is part of the MySQL Workbench, so you can see what is happening.

Also good for the toolchain is the SQL WB plugin, mysql-wb-exportsqlite , which can export a SQlite create script.

I am working on MySQL Workbench 6.2 (Debian apt-get one), but the script also works with versions 6.3.

0
source

Source: https://habr.com/ru/post/1778011/


All Articles