Rayfin automatically pluralizes entity source table names using English rules, breaking existing non-English database schemas
@seanwat-msft is already working on this.
Since Jul 15, 2026.
- Dominant language
- No language data
- Stars
- 610
- Forks
- 62
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 3
Description
What happened?
Rayfin pluralizes entity/table names using English rules by default when using @entity(), which breaks applications whose database table names are already defined in another language or must be preserved exactly.
Example:
Original table name fromSQL Server:
MovimentoContabil
Rayfin generated source table name:
MovimentoContabils
Another example:
ProjetosUnidadesOperacionaisMacroentregas
became:
ProjetosUnidadesOperacionaisMacroentregases
This causes schema drift and runtime errors because the existing application expects the exact original table names. In Portuguese, adding s or es this way produces invalid table names and changes the domain vocabulary.
Expected behavior:
Rayfin should provide a first-class way to explicitly set the database source table name independently from the entity name, for example:
@entity({ name: "MovimentoContabil", source: "MovimentoContabil" })
or avoid automatic pluralization unless explicitly requested.
Current workaround:
Register every entity with EntityNameResolver.setCustomPlural(name, name) before schema analysis and before frontend GraphQL query generation. This works, but it is not obvious from the default @entity() flow and is easy to miss during migrations from existing databases.
Steps to reproduce
- Create a Rayfin app with a data entity whose existing SQL table name is already pluralized or uses non-English domain naming, for example:
@entity()
export class MovimentoContabil {
@uuid()
guid!: string;
}
Register the entity in rayfin/data/schema.ts.
Run the Rayfin deploy/generation command:
npx rayfin up
Inspect the generated DAB configuration or the created SQL tables.
Notice that Rayfin automatically pluralizes the entity/table name using English pluralization rules.
Expected table/source name:
MovimentoContabil
Actual generated table/source name:
MovimentoContabils
Another observed example:
Expected:
ProjetosUnidadesOperacionaisMacroentregas
Actual:
ProjetosUnidadesOperacionaisMacroentregases
### Environment
**Environment**
```markdown
- OS: Microsoft Windows 11 Pro 10.0.26200
- Node.js: v24.14.0
- npm: 11.9.0
- Rayfin CLI: 1.33.2, built Jun 12, 2026, 09:18 PM UTC
- Browser: Microsoft Edge / Chromium, local dev through Vite
- Database dialect: MSSQL / Microsoft Fabric SQL database
- Fabric region used successfully: Brazil South
### Logs or screenshots
```shell
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.