#Dynamic TypeOrmModule name

4 messages · Page 1 of 1 (latest)

spiral rampart
#

Sorry for the repost, I didn't see that there was a database specific channel ! 🙂


Hi ! Is there a way to use a dynamic name based on the request for the TypeOrmModule when using useFactory ?

Reference : https://docs.nestjs.com/techniques/database#multiple-databases

In the documentation and the type definition it don't seems to be possible..

gilded mural
#

yes

#

for each database you have to specify a name for each database

#
 TypeOrmModule.forFeature([TenantEntity], 'DB_NAME'),