cli icon indicating copy to clipboard operation
cli copied to clipboard

Proposal: Controller Generation in Sequelize

Open flyyuan opened this issue 2 years ago • 0 comments

Proposal: Controller Generation in Sequelize

Inspired by the Rails framework, I'm considering introducing a feature in Sequelize that would allow users to generate controllers alongside models, streamlining the development process for many.

Command and Output:

The envisioned command would be:

sequelize generate:model User -c koa

If the -c flag is followed by koa, Sequelize would generate a Koa-compatible controller. Similarly, specifying other frameworks like express or fastify would generate controllers tailored for them.

Implementation Plan:

  1. Templating:

    • Create templates for popular Node.js web frameworks (e.g., Express, Koa, Fastify).
    • Allow users to specify their framework of choice during generation.
  2. Configuration Options:

    • Offer customization options for the generated controllers.
  3. Basic CRUD Logic:

    • Include essential CRUD operations in the generated controllers.

Seeking Preliminary Discussion:

Before diving into the development, I wanted to discuss this with you to gauge its feasibility and alignment with Sequelize's vision. I'm fully prepared to develop this PR, but I believe a preliminary discussion would be invaluable.

Your insights and feedback would be greatly appreciated. If this proposal aligns with Sequelize's direction, I'm eager to start working on it and contribute to the project.

Thank you for your time and consideration.

### Tasks

flyyuan avatar Aug 10 '23 02:08 flyyuan