UNPKG

@megaorm/cli

Version:

This package allows you to communicate with MegaORM via commands directly from the command line interface (CLI).

36 lines (35 loc) 1.47 kB
import { MegaCommand } from '../MegaCommand'; /** * Represents a command to execute all seeder files in the project's seeders folder in order. * * The command performs the following actions: * - Resolves the path to the seeders folder based on the configuration. * - Identifies all seeder files in the folder. * - Executes each seeder file in the correct order to populate tables with data. * * This ensures that the seeding process is orderly and consistent, allowing for the initialization * or population of database tables as defined by the seeder files. * * @extends MegaCommand */ export declare class SeedCommand extends MegaCommand { protected static syntax: string; /** * Resolves the appropriate path for the seeders folder based on the configuration. * * @param config The MegaORM configuration object. * @returns The resolved path for the seeders folder. * @throws `MegaCommandError` if `paths.seeders` is absolute and TypeScript is enabled. */ private static path; /** * Executes the command to process and run all seeder files. * * The command identifies all seeder files in the folder and executes them * in the correct order to seed the database tables with data. * * @returns A promise that resolves when all seeder files have been executed successfully * or rejects with an error if any of the seeders fail. */ static exec(): Promise<unknown>; }