Skip to content

TypeORM Codegen: Custom name for the entity #395

@sandrosimas

Description

@sandrosimas

Currently, the entity name is always generated based on the model name.
It would be nice if we could pass a custom name for the entity (e.g., the table name in the plural like accounts):

The @Entity_() is hardcoded without any argument, as you can see below:

out.line('@Entity_()')

In the file below, EntityOptions has a name attribute.

An argument called name could be available in the entity directive:
@entity(name: "accounts")

I tried manually updating the generated entity with @Entity_({ name: 'tokens' }) and I was able to save a token in my processor.

Do you know if I can face problems by changing this manually?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions