I am beginner in sailsjs, i have multiple databases but table structure is same. So i would like to use single model and controller for all these databases.
I know we can set connection attribute in model like this
module.exports = {
connection: 'mysqlServer1',
attributes: {
userid: {
type: 'integer',
primaryKey: true
},
fbid: {
type: 'string'
},
source: {
type: 'string'
}
}
}
};
But how can we set connection dynamically runtime?
Thanks