@megaorm/cli
Version:
This package allows you to communicate with MegaORM via commands directly from the command line interface (CLI).
34 lines (33 loc) • 1.4 kB
TypeScript
import { MegaCommand } from '../MegaCommand';
/**
* Represents a command to drop all tables associated with generator files.
*
* The command performs the following actions:
* - Resolves the path to the generators folder based on the configuration.
* - Drops all tables associated with the generator files.
*
* This ensures that the database is cleared of any generator-created tables,
* making it easy to reset or reinitialize the database schema.
*
* @extends MegaCommand
*/
export declare class ResetCommand 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 reset the database by dropping all tables associated with generators.
*
* The command ensures that all generator-related tables are dropped, providing a fresh start.
* This can be useful during development or testing when a clean database state is required.
*
* @returns A promise that resolves when the tables have been successfully dropped
* or rejects with an error if the operation fails.
*/
static exec(): Promise<unknown>;
}