@joakimbugge/mikroorm-seeder / MultiSeed
Interface: MultiSeed<T>
Defined in: seed/builder.ts:32
Seed builder for multiple entity classes. Returned by seed when passed an array. Each method returns a tuple of instances in the same order as the input array. Relation seeding is disabled by default; pass relations: true in the context to enable it.
Type Parameters
T
T extends readonly EntityConstructor[]
Methods
create()
create(context?): Promise<MapToInstances<T>>;Defined in: seed/builder.ts:34
Creates one instance of each class in memory without persisting.
Parameters
context?
Returns
Promise<MapToInstances<T>>
createMany()
createMany(count, context?): Promise<MapToInstanceArrays<T>>;Defined in: seed/builder.ts:38
Creates count instances of each class in memory without persisting.
Parameters
count
number
context?
Returns
Promise<MapToInstanceArrays<T>>
save()
save(options): Promise<MapToInstances<T>>;Defined in: seed/builder.ts:36
Creates and persists one instance of each class.
Parameters
options
Returns
Promise<MapToInstances<T>>
saveMany()
saveMany(count, options): Promise<MapToInstanceArrays<T>>;Defined in: seed/builder.ts:40
Creates and persists count instances of each class.
Parameters
count
number
options
Returns
Promise<MapToInstanceArrays<T>>