sequelize-auto icon indicating copy to clipboard operation
sequelize-auto copied to clipboard

How to generate class based model of mssql in sequelize-auto

Open Hammasali47 opened this issue 2 years ago • 1 comments

I am using sequelize auto command like this

sequelize-auto -h -d -u -x [password] -p [port] --dialect [dialect] -c [/path/to/config] -o [/path/to/models] -t [tableName]

however sequelize-auto generate model of that table in functional form.Is there any way to generate class based model of mssql database using sequelize-auto?

Hammasali47 avatar Dec 22 '22 08:12 Hammasali47

Hello, You can use the --lang option to switch to es6/esm/ts to switch to the class based init method, instead of the define method.

sequelize-auto -h -d -u -x [password] -p [port] --dialect [dialect] -c [/path/to/config] -o [/path/to/models] -t [tableName] --lang es6

This will solve your problem

abdulbari149 avatar Jan 08 '23 22:01 abdulbari149