Skip to content

Allow sharing of model definitions among datasources #60

Open
@Damienmarble

Description

@Damienmarble

Is your feature request related to a problem? Please describe.
My organization is creating a multitenant application using Sails, with Sequelize as our ORM to connect to existing database(s). Our goal is for new tenants with separate datasources to be able to be added purely through configuration changes. However, currently each model can be associated with only a single Sequelize instance.

Describe the solution you'd like
A way to namespace Models so that model multiple instances which function identically but point to different datasources can be created.

Describe alternatives you've considered
We could create separate model definitions for each tenant and explicitly name which datasource to associate with, but this violates our configuration-only requirement and will caused an ever-increasing maintenance burden as the number of models, tenants and places where they are used grow. (x models times y tenants times z places where a model is used and which one to use must be determined)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions