UNPKG

@mikro-orm/seeder

Version:

Seeder package for MikroORM.

26 lines (25 loc) 1.14 kB
import { type Constructor, type EntityManager, type ISeedManager, type MikroORM } from '@mikro-orm/core'; import type { Seeder } from './Seeder.js'; /** Manages discovery and execution of database seeders. */ export declare class SeedManager implements ISeedManager { #private; constructor(em: EntityManager); private init; static register(orm: MikroORM): void; /** * Checks if `src` folder exists, it so, tries to adjust the migrations and seeders paths automatically to use it. * If there is a `dist` or `build` folder, it will be used for the JS variant (`path` option), while the `src` folder will be * used for the TS variant (`pathTs` option). * * If the default folder exists (e.g. `/migrations`), the config will respect that, so this auto-detection should not * break existing projects, only help with the new ones. */ private detectSourceFolder; seed(...classNames: Constructor<Seeder>[]): Promise<void>; /** * @internal */ seedString(...classNames: string[]): Promise<void>; create(className: string): Promise<string>; private generate; }