This is implement Example of This stackoverflow Answers
TypeOrm basic config in NestJs is singleton. but, For using MultiTenancy database structure, It's Scope should be REQUEST or TRANSIENT.
Reference : https://docs.nestjs.com/fundamentals/injection-scopes https://docs.nestjs.com/fundamentals/custom-providers#factory-providers-usefactory
When user come to Controller, controller and service instance is made. then service find 'injected' 'CONNECTION'
'CONNECTION' is provided globally from tenancy module, connectionFactory make connection for condition, and passing it to service.
If you know Better way to using multi Tenancy Database structure at Nestjs, Please tell me!