Skip to content

Model binder fails with improper pluralization for table name resolution #13

@acidjazz

Description

@acidjazz

Problem

The model binder in src/runtime/server/utils/binder.ts currently uses naive pluralization by simply appending "s" to model names when looking up database tables. This causes failures for:

  • Words that don't pluralize: smssmss (should stay sms)
  • Sibilants requiring "es": kisskisss (should be kisses)
  • Consonant + y words: citycitys (should be cities)
  • Words ending in f/fe: leafleafs (should be leaves)
  • Other irregular pluralization patterns

Expected Behavior

The model binder should intelligently handle English pluralization rules and fall back to the original model name when appropriate.

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