Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hello everyone , i am Tung . i have a issues , please help me ! , #3

Open
Nguyen-Dinh-Tung opened this issue Jun 14, 2023 · 0 comments

Comments

@Nguyen-Dinh-Tung
Copy link

Nguyen-Dinh-Tung commented Jun 14, 2023

i cannot import typeorm to nestgram module , help me
@module({
services: [TelegramBotCommandService],
controllers: [TelegramBotController],
imports: [TypeOrmModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: (configService: ConfigService) => ({
type: 'mysql',
host: configService.get('DB_HOST'),
port: configService.get('DB_PORT'),
username: configService.get('DB_USERNAME'),
password: configService.get('DB_PASSWORD'),
database: configService.get('DB_NAME'),
entities: [join(__dirname, 'dist/src/**/*.entity.{ts,js}')],
synchronize: true,
autoLoadEntities: true,
logging: true,
}),
async dataSourceFactory(options) {
if (!options) {
throw new Error('Invalid options passed');
}

  return addTransactionalDataSource(new DataSource(options));
},

}),],
})
export class TelegramBotCommandModule {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant