BE/src/db/db.config.ts

21 lines
846 B
TypeScript
Raw Normal View History

2025-02-24 10:32:41 +05:30
import { ConfigService } from '@nestjs/config';
export const getOracleConfig = (configService: ConfigService) => ({
2025-06-06 10:36:04 +05:30
user: configService.get<string>('ORACLE_USER', ''),
password: configService.get<string>('ORACLE_PASSWORD', ''),
connectString: configService.get<string>('ORACLE_CONNECT_STRING', ''),
2025-02-24 10:32:41 +05:30
});
export const getMssqlConfig = (configService: ConfigService) => ({
2025-06-06 10:36:04 +05:30
server: configService.get<string>('MSSQL_SERVER', ''),
port: parseInt(configService.get<string>('MSSQL_PORT', '1433'), 10), // 1433 is MSSQL default port
user: configService.get<string>('MSSQL_USER', ''),
password: configService.get<string>('MSSQL_PASSWORD', ''),
database: configService.get<string>('MSSQL_DATABASE', ''),
2025-02-24 10:32:41 +05:30
options: {
enableArithAbort: true,
trustServerCertificate: true,
2025-06-06 10:36:04 +05:30
encrypt: true,
2025-02-24 10:32:41 +05:30
},
2025-06-06 10:36:04 +05:30
});