# @joakimbugge/seeders > Decorator-based entity seeding for TypeORM and MikroORM. Annotate entity properties with `@Seed()` to describe how they should be populated, then create or persist fully populated entity graphs — including relations, embedded types, and circular guards — with a single call. Four packages across two ORM families. The NestJS packages are thin DI wrappers around the core libraries. - `@joakimbugge/typeorm-seeder`: Core seeding library for TypeORM - `@joakimbugge/nest-typeorm-seeder`: NestJS integration module for TypeORM - `@joakimbugge/mikroorm-seeder`: Core seeding library for MikroORM - `@joakimbugge/nest-mikroorm-seeder`: NestJS integration module for MikroORM ## typeorm-seeder - [Getting started](https://joakimbugge.github.io/seeders/guide/): Installation, tsconfig requirements, quick example - [What is seeding?](https://joakimbugge.github.io/seeders/guide/what-is-seeding): Seeding vs factories vs fixtures; why decorator-based; when to use it - [How it works](https://joakimbugge.github.io/seeders/guide/how-it-works): The four methods — `create`, `createMany`, `save`, `saveMany`; mental model - [Decorating entities](https://joakimbugge.github.io/seeders/guide/decorating-entities): `@Seed()` on scalars, relations, tree properties; sequence index; circular guard; bidirectional relations; `@Seed()` always creates new entities (not selects existing) - [Seeding entities](https://joakimbugge.github.io/seeders/guide/seeding-entities): `seed()` builder; `values` overrides; `relations` flag; `SeedContext`; depending on earlier properties - [Tree entities](https://joakimbugge.github.io/seeders/guide/advanced-patterns/tree-entities): `@TreeParent`, `@TreeChildren`, all four TypeORM tree strategies - [Seeder suites](https://joakimbugge.github.io/seeders/guide/seeder-suites): `@Seeder`, `runSeeders`, dependency ordering, concurrent execution, returning entities, seeding without `@Seed()` - [Running scripts](https://joakimbugge.github.io/seeders/guide/running-scripts): `reflect-metadata` import, ts-node vs tsx, `loadEntities`, `loadSeeders` - [CLI](https://joakimbugge.github.io/seeders/guide/cli): `seed:run`, `seed:entities`, `seed:list`, `seed:untrack`; DataSource config file - [Logging](https://joakimbugge.github.io/seeders/guide/logging): `logging: true`, `logging: 'typeorm'`, custom `SeederLogger` - [Hooks](https://joakimbugge.github.io/seeders/guide/hooks): class-level hooks (`onBefore`, `onSuccess`, `onError`, `onFinally` methods on the seeder class); global `runSeeders` hooks (`onBefore`, `onSuccess`, `onError`, `onFinally` callbacks); `skip`; lifecycle logging - [Troubleshooting](https://joakimbugge.github.io/seeders/guide/troubleshooting): Undefined relations, factory context, test isolation, tree persistence, batch operations ## nest-typeorm-seeder - [Getting started](https://joakimbugge.github.io/seeders/nest/): `SeederModule.forRoot`, auto-detected DataSource, glob patterns, `forRootAsync` - [Run once](https://joakimbugge.github.io/seeders/nest/run-once): Tracking table, `runOnce` flag, `dropSchema` interaction, re-seeding with `seed:untrack` - [Feature modules](https://joakimbugge.github.io/seeders/nest/feature-modules): `SeederModule.forFeature`, cross-module seeder dependencies - [Seed scripts](https://joakimbugge.github.io/seeders/nest/seed-scripts): Inline `run` callback, using `seeders` and `run` together - [Troubleshooting](https://joakimbugge.github.io/seeders/nest/troubleshooting): Seeders running twice or not at all, bootstrap order ## mikroorm-seeder - [Getting started](https://joakimbugge.github.io/seeders/mikroorm/): Installation, quick example with `EntityManager` - [What is seeding?](https://joakimbugge.github.io/seeders/guide/what-is-seeding): Seeding vs factories vs fixtures; why decorator-based; when to use it - [How it works](https://joakimbugge.github.io/seeders/guide/how-it-works): The four methods — `create`, `createMany`, `save`, `saveMany`; mental model - [Decorating entities](https://joakimbugge.github.io/seeders/mikroorm/decorating-entities): `@Seed()` on MikroORM `@Property()` and relation decorators; circular guard; bidirectional relations; `@Seed()` always creates new entities (not selects existing) - [Seeding entities](https://joakimbugge.github.io/seeders/mikroorm/seeding-entities): `seed()` builder with `em` instead of `dataSource`; `values` overrides; `relations` flag - [Seeder suites](https://joakimbugge.github.io/seeders/mikroorm/seeder-suites): `@Seeder`, `runSeeders` with MikroORM - [Running scripts](https://joakimbugge.github.io/seeders/mikroorm/running-scripts): Script execution with MikroORM - [CLI](https://joakimbugge.github.io/seeders/mikroorm/cli): CLI for MikroORM - [Logging](https://joakimbugge.github.io/seeders/mikroorm/logging): Logging options - [Hooks](https://joakimbugge.github.io/seeders/mikroorm/hooks): class-level hooks (`onBefore`, `onSuccess`, `onError`, `onFinally` methods on the seeder class); global `runSeeders` hooks (`onBefore`, `onSuccess`, `onError`, `onFinally` callbacks); `skip`; lifecycle logging - [Troubleshooting](https://joakimbugge.github.io/seeders/guide/troubleshooting): Undefined relations, factory context, test isolation, tree persistence, batch operations ## nest-mikroorm-seeder - [Getting started](https://joakimbugge.github.io/seeders/nest-mikroorm/): `SeederModule` for MikroORM + NestJS - [Run once](https://joakimbugge.github.io/seeders/nest-mikroorm/run-once): Run-once tracking - [Feature modules](https://joakimbugge.github.io/seeders/nest-mikroorm/feature-modules): `forFeature` pattern - [Seed scripts](https://joakimbugge.github.io/seeders/nest-mikroorm/seed-scripts): Inline `run` callback - [Troubleshooting](https://joakimbugge.github.io/seeders/nest-mikroorm/troubleshooting): Seeders running twice or not at all, bootstrap order ## API Reference - [typeorm-seeder API](https://joakimbugge.github.io/seeders/api/typeorm-seeder/) - [nest-typeorm-seeder API](https://joakimbugge.github.io/seeders/api/nest-typeorm-seeder/) - [mikroorm-seeder API](https://joakimbugge.github.io/seeders/api/mikroorm-seeder/) - [nest-mikroorm-seeder API](https://joakimbugge.github.io/seeders/api/nest-mikroorm-seeder/)