Auto-Generating Models for Sequestration

I want to start using Sequelize, a module that allows ORM for mysql in node.js. I was wondering if it is possible to automatically create models like CakePHP. In CakePHP, it will read table information and automatically create associations and fields with their types in the model. I really really would not want to completely display all my tables manually, as some of them are relatively large. Is there something that will do this for me? Or can I deal with all the models myself?

+4
source share
2 answers

You can automatically generate models through sequelize-auto. Just follow the following link https://github.com/sequelize/sequelize-auto

It will generate models of your table.

+4
source

see https://github.com/sequelize/sequelize/issues/339

Sequelize provides methods for reading existing database table names. In addition, there is a way to read the structure of the table. In combination, it should be possible to automate the creation of models.

+1
source

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


All Articles