Skip to content

Separate naming in web crate from db crate #187

@marcoow

Description

@marcoow

We currently do the same thing that's bad about Rails which is pushing people towards having a single concept of entity from the JSON API to the database table. E.g. for CRUD controllers, we use one name, e.g. notes that we then use for the controller's module name as well as to guess the name of the entity and the names of the functions to create, load, etc. entities.

We should have better separation here and use separate arguments for the controller name and for the entity name. In many cases both would be the same which would still not mean lots of additional effort for the developer (really just a few extra characters need to be typed) e.g.

cargo generate crud-controller notes Note

In some cases, the controller and entity names could also be different though, e.g.:

cargo generate crud-controller tasks Todo

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions