import { Global, Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; import { PostgresConfiguration } from './database.config'; import { ConfigModule } from '@nestjs/config'; @Global() @Module({ imports: [ TypeOrmModule.forRootAsync({ useClass: PostgresConfiguration, }), ConfigModule.forRoot({ isGlobal: true }), ], // providers: [MySqlConfiguration], exports: [TypeOrmModule], }) export class DatabaseModule {}