"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDatabaseConfig = void 0;
var getDatabaseConfig = function (configService) { return ({
    type: 'postgres',
    host: configService.get('DB_HOST', 'localhost'),
    port: configService.get('DB_PORT', 5432),
    username: configService.get('DB_USERNAME', 'postgres'),
    password: configService.get('DB_PASSWORD', 'postgres'),
    database: configService.get('DB_NAME', 'rtvgo'),
    entities: [__dirname + '/../**/*.entity{.ts,.js}'],
    synchronize: configService.get('DB_SYNC', true),
    logging: configService.get('NODE_ENV', 'development') === 'development',
    ssl: configService.get('DB_SSL', false)
        ? { rejectUnauthorized: false }
        : false,
}); };
exports.getDatabaseConfig = getDatabaseConfig;
