Skip to content

@joakimbugge/typeorm-seeder


@joakimbugge/typeorm-seeder / save

Function: save()

Call Signature

ts
function save<T>(EntityClass, options): Promise<T>;

Defined in: seed/persist.ts:116

Creates and persists a seed entity and all its seeded relations.

Type Parameters

T

T extends object

Parameters

EntityClass

EntityConstructor<T>

options

SaveOptions<T>

Returns

Promise<T>

Call Signature

ts
function save<T>(EntityClasses, options): Promise<MapToInstances<T>>;

Defined in: seed/persist.ts:124

Creates and persists one instance 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

SaveOptions

Returns

Promise<MapToInstances<T>>

Released under the MIT License.