Skip to content

@joakimbugge/typeorm-seeder


@joakimbugge/typeorm-seeder / createMany

Function: createMany()

Call Signature

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

Defined in: seed/creator.ts:238

Creates multiple entity instances in memory without persisting them.

When passed an array of classes, returns a tuple of arrays — one per class — each containing count instances. Relation seeding is disabled by default for the array variant; pass relations: true in the options to override.

Type Parameters

T

T extends object

Parameters

EntityClass

EntityConstructor<T>

options

CreateManyOptions<T>

Returns

Promise<T[]>

Call Signature

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

Defined in: seed/creator.ts:242

Creates multiple entity instances in memory without persisting them.

When passed an array of classes, returns a tuple of arrays — one per class — each containing count instances. Relation seeding is disabled by default for the array variant; pass relations: true in the options to override.

Type Parameters

T

T extends readonly EntityConstructor[]

Parameters

EntityClasses

[...T[]]

options

CreateManyOptions

Returns

Promise<MapToInstanceArrays<T>>

Released under the MIT License.