UNPKG

adonis-odm

Version:

A comprehensive MongoDB ODM for AdonisJS with Lucid-style API, type-safe relationships, embedded documents, and transaction support

31 lines (30 loc) 796 B
/** * ODM Configuration Helper */ /** * Define ODM configuration */ export function defineConfig(config) { return config; } /** * Get seeder configuration with defaults * * @param config - The ODM configuration object * @returns Seeder configuration with defaults applied */ export function getSeederConfig(config) { const defaultSeederConfig = { paths: ['./database/seeders'], defaultConnection: config.connection, }; if (!config.seeders) { return defaultSeederConfig; } return { paths: config.seeders.paths && config.seeders.paths.length > 0 ? config.seeders.paths : defaultSeederConfig.paths, defaultConnection: config.seeders.defaultConnection || defaultSeederConfig.defaultConnection, }; }