loopbackio / loopbackio/loopback-next

Allow Class/Model Name to Have A Different Name From the Database Table

Open
#2,134 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

CLI developer-experience feature good first issue
Dominant language
TypeScript
Stars
5.1k
Forks
1.1k
Avg merge
2d 21h
Merged PRs (30d)
27

Description

Description / Steps to reproduce / Feature proposal

Create/map a class/model with a name different from the name in its MySQL table

Current Behavior

If the class name is different, there is no way to map it to the correct table having a different name.

Expected Behavior

Just like individual properties inside the class, a class/model should be allowed to be exposed with a custom name different from that in the database table.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the TypeScript model-to-table mapping and the MySQL integration points in the repository. Review existing mapping behavior and tests before defining the change; it is done when a model with a different class name can map to its intended table without breaking property mappings.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, typescript
Domain
backend-api-design, database
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.