sequelize-modelgen-mysql

0.0.10 • Public • Published

sequelize-modelgen-mysql

This is a private project for now, do not rely on it.

This is based on sequelize-auto.

This package didn't had the support I needed for MySql and was missing some features I needed, like table metadata (freezeTableNames, timestamps, etc), and patching it would be too much effort since the code generation was (at the time of writing) done by string concatenation and, given that said package supports other dialects, the code was too hard to change for the little time I had.

As I previously mentioned this code is just good enough to cover my use-case.

Do not rely on this for production apps!

options file example (see the docs for more info):

module.exports = {
	tables: {
		//optional, config to apply to all tables
		global: {
			timestamps: false,
			freezeTableName: true
		},
		//optional, if present it will be used INSTEAD of global, there is no merge between them
		my_special_table_name: {
			timestamps: true
		}
	}
}

Readme

Keywords

none

Package Sidebar

Install

npm i sequelize-modelgen-mysql

Weekly Downloads

1

Version

0.0.10

License

MIT

Last publish

Collaborators

  • f_leandro