UNPKG

typeorm-extension

Version:

A library to create/drop database, simple seeding data sets, ...

25 lines (24 loc) 1.33 kB
import type { DataSource, DataSourceOptions, QueryRunner } from 'typeorm'; import { SeederEntity } from './entity'; import type { SeederExecutorOptions, SeederOptions, SeederPrepareElement } from './type'; export declare class SeederExecutor { protected dataSource: DataSource; protected options: SeederExecutorOptions; private readonly tableName; constructor(dataSource: DataSource, options?: SeederExecutorOptions); execute(input?: SeederOptions): Promise<SeederEntity[]>; protected loadExisting(queryRunner: QueryRunner): Promise<SeederEntity[]>; /** * Gets all migrations that setup for this connection. */ protected buildEntities(seeds?: SeederPrepareElement[]): Promise<SeederEntity[]>; protected checkForDuplicates(entities: SeederEntity[]): void; protected createTableIfNotExist(queryRunner: QueryRunner): Promise<void>; protected track(queryRunner: QueryRunner, seederEntity: SeederEntity): Promise<void>; protected get dataSourceOptions(): DataSourceOptions & SeederOptions; protected get database(): string | undefined; protected get schema(): string | undefined; protected get table(): string; protected buildOptions(input?: SeederOptions): Promise<SeederOptions>; protected classNameToTimestamp(className: string): number | undefined; }