hapipal / schwifty

A model layer for hapi integrating Objection ORM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow models to provide a custom schwifty model name

devinivy opened this issue · comments

Introduce a symbol Schwifty.name that may be placed on a model (i.e. staticly) to override the name of the model available via server.models(): an override for the model's class name.

I'm now wondering if this is really necessary, especially with namespacing and sandboxing landing in #84 which allows for duplicate model names on the same server. Originally this seemed like a good idea to come into parity with schmervice, but in schmervice we needed a way to name services that didn't come from a class— the same issue doesn't exist here since all models are classes. The model's name is significant to objection too, so we'd have to take that into account. I will leave it open for a bit to gather feedback. If there's not interest we can close this for the time being.

It's been well over a month without a peep, so I'm going to close this feature request for now.