Open SirMishaa opened 3 years ago
Hello !
For some reason, I'm using a factory to create the configuration for TypeORM Is it possible to upload this file? So that I can launch my fixture ?
// database.module.ts import { Logger, Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; import { ConfigModule, ConfigService } from '@nestjs/config'; @Module({ imports: [ TypeOrmModule.forRootAsync({ imports: [ConfigModule], useFactory: (configService: ConfigService) => { configService.get<boolean>('synchronizeMigration') && new Logger(DatabaseModule.name).warn( 'The synchronization of models are activated, be careful', ); return { type: 'postgres', host: configService.get<string>('database.host'), port: configService.get<number>('database.port'), username: configService.get<string>('database.user'), password: configService.get<string>('database.password'), database: configService.get<string>('database.databaseName'), entities: [__dirname + '../../../**/*.entity.{js,ts}'], synchronize: configService.get<boolean>('synchronizeMigration'), }; }, inject: [ConfigService], }), ], }) export class DatabaseModule {}
Kind regards
I've got the same problem. The TypeORM configuration in NestJS isn't loaded from a config file but from the master module through a factory.
Is the typeorm-fixture CLI you're providing supporting such a use case ?
Hello !
For some reason, I'm using a factory to create the configuration for TypeORM Is it possible to upload this file? So that I can launch my fixture ?
Kind regards