import { Global, Module } from '@nestjs/common';
import { ConfigModule as NestConfig, ConfigService } from '@nestjs/config';
import { KnexModule } from 'nest-knexjs';

@Global()
@Module({
    imports: [
        NestConfig.forRoot({isGlobal: true}),
        KnexModule.forRoot({
            config: {
                client: 'mysql2',
                connection: {
                    host: 'localhost',
                    user: 'ynewco_erp',
                    password: 'cJgre9~(V(Jp',
                    database: 'ynewco_erp_3',
                }
            }
        })
    ],
    providers: [ConfigService],
    exports: [NestConfig],
    
})
export class ConfigModule {}
