Looking to implement a multi-tenant NestJS solution using the new request injection scope feature of NestJS 6.
For any given service I assume I could do something like this:
@Injectable({scope: Scope.REQUEST})
export class ReportService implements OnModuleInit { ... }
then, in the constructor, determine the tenant from the request, connect to the appropriate database, and instantiate repositories for the new connection.
I'm wondering if this is the most straightforward way to go about it?
Instead of updating each service, is it possible to override the connection provider and scope that to the request?