Skip to content

@joakimbugge/typeorm-seeder


@joakimbugge/typeorm-seeder / saveMany

Function: saveMany()

Call Signature

ts
function saveMany<T>(EntityClass, options): Promise<T[]>;

Defined in: seed/persist.ts:154

Creates and persists multiple seed entities of the same class. Applies the same logic as save for each entity.

Type Parameters

T

T extends object

Parameters

EntityClass

EntityConstructor<T>

options

SaveManyOptions<T>

Returns

Promise<T[]>

Call Signature

ts
function saveMany<T>(EntityClasses, options): Promise<MapToInstanceArrays<T>>;

Defined in: seed/persist.ts:162

Creates and persists multiple instances of each entity class in the array. Relation seeding is disabled by default; pass relations: true to override.

Type Parameters

T

T extends readonly EntityConstructor[]

Parameters

EntityClasses

[...T[]]

options

SaveManyOptions

Returns

Promise<MapToInstanceArrays<T>>

Released under the MIT License.