How to configure two different datasource for a model in Strongloop Loopback framework?

前端 未结 3 1632

Our MySQL database are set up with Write clusters and Read clusters, is there a way to set up Strongloop Loopback Model (e.g. User) to Write to MySQL Host A and Read from My

3条回答
  •  既然无缘
    2021-01-05 09:23

    In loopback 2.0, You can try overriding getDataSource method and based on context, you can return different dataSource. However in loopback 3.0, context has been removed, and options is not passed to getDataSource, so it will be a challenge to achieve perfection.

提交回复
热议问题