sequelize / sequelize-auto

Automatically generate bare sequelize models from your database.
2.91k stars 529 forks source link

RFC: Changing the defaults for case and singularize #472

Open steveschmitt opened 3 years ago

steveschmitt commented 3 years ago

When using sequelize-auto, I find that I'm always using the following options:

--caseModel p for PascalCase model names --caseFile l for lower_case file names --caseProp c for camelCase property names --singularize for singular model names (User, not Users)

In other words, I like PascalCase model names, lower_case file names, camelCase property names, and singular model names (User. not Users).

I'm considering making these values the default because I think they are popular conventions for Sequelize and JavaScript code.

The current default is to directly use whatever the table and column names are in the database, without changing the case or plural.

Naturally, if we change the default, you can still specify --cm o --cf o --cp --sg false to use the database values, but that puts the burden on those who want the original behavior.

What do you think?

JonathanWolfe commented 3 years ago

I agree with changing the defaults to these (I also use them except singularize, as I perfer pluralized). It'll have to be a major version bump though since it'll affect the entire output.

Akxe commented 3 years ago

To be closed?