@joakimbugge/mikroorm-seeder / SeedFactory
Type Alias: SeedFactory<T, TEntity>
ts
type SeedFactory<T, TEntity> = BaseSeedFactory<T, TEntity, SeedContext>;Defined in: packages/mikroorm-seeder/src/seed/decorator.ts:18
Factory callback passed to @Seed. Receives the MikroORM seed context, the partially built entity, and a zero-based index that counts up across a createMany/saveMany batch.
Properties are seeded sequentially in declaration order, so any property declared above the current one is already set on self and can be read to derive the current value.
Type Parameters
T
T = unknown
TEntity
TEntity = any
Example
ts
@Seed((_, __, i) => `user-${i}@example.com`)
email!: string