@megaorm/cli
Version:
This package allows you to communicate with MegaORM via commands directly from the command line interface (CLI).
35 lines (34 loc) • 1.39 kB
TypeScript
import { MegaCommand } from '../MegaCommand';
/**
* Represents a command to execute generator files in the project's generators folder.
*
* The command performs the following actions:
* - Resolves the path to the generators folder based on the configuration.
* - Identifies generator files that have not been executed yet.
* - Executes only the new generator files to create tables.
*
* This ensures that previously executed generator files are not re-executed, maintaining efficiency
* and avoiding duplication of database operations.
*
* @extends MegaCommand
*/
export declare class GenerateCommand extends MegaCommand {
/**
* Resolves the appropriate path for the generators folder based on the configuration.
*
* @param config The MegaORM configuration object.
* @returns The resolved path for the generators folder.
* @throws `MegaCommandError` if `paths.generators` is absolute and TypeScript is enabled.
*/
private static path;
/**
* Executes the command to process generator files.
*
* The command identifies generator files that have not been executed yet
* and executes them to create tables as defined in the files.
*
* @returns A promise that resolves when the new generator files have been executed successfully
* or rejects with an error.
*/
static exec(): Promise<unknown>;
}