loopbackio / loopbackio/loopback-next

Add option to allow rule for column name

Open
#6,737 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature Repository
Dominant language
TypeScript
Stars
5.1k
Forks
1.1k
Avg merge
2d 21h
Merged PRs (30d)
27

Description

Background

Current by default the property is "lowercased".
If we want to custom it, we must use:

postgresql: {
  columnName: 'custom_name',
},

This is huge headache if system have hundred of tables hence possibly thousand of column names to customize.

Suggestion

We should provide an option in the connector level to allow users to compute column name as keep, lowercase, UPPERCASE, snake_case, camelCase, PascalCase, or custom function columnNameFn(propertyName: string) => string

E.g:

const dataSourceConfig = {
  name: 'db',
  connector: 'postgresql',
  columnNameComputation: 'snake_case',
  ...
}

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 connector-level configuration handling and the PostgreSQL column-name mapping; the issue provides no file or test entry point. Review how per-property columnName settings are currently applied. Done means the connector-level option supports the requested naming modes and a custom columnNameFn across the relevant mappings.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, typescript
Domain
backend, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.