How can I select different databases for a model based on request parameters in Sails.js?

孤人 提交于 2019-12-06 11:39:35

问题


I have an application that I am considering porting to Sails.JS.

One of the big issues I am having is supporting the per-request database selection that we have right now.

Our app creates/uses a different database for each customer that we have and we select the database based on the request.

How could I achieve that in Sails.JS?

Could I write a Express middleware that would do this on a per request basis?

来源:https://stackoverflow.com/questions/26930432/how-can-i-select-different-databases-for-a-model-based-on-request-parameters-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!