File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,7 +55,18 @@ export class AppModule {}
5555```
5656
5757The ` forRoot() ` method accepts the same configuration object as ` init() ` from the MikroORM package.
58- You can also omit the parameter to use the CLI config.
58+ Since v7, the configuration must be provided explicitly — passing the options is required
59+ (see the [ v6 to v7 upgrading guide] ( https://mikro-orm.io/docs/upgrading-v6-to-v7#mikroorminit-requires-options-parameter ) ).
60+ If you keep your config in a separate file (e.g. ` mikro-orm.config.ts ` ), import it and pass it in:
61+
62+ ``` typescript
63+ import config from ' ./mikro-orm.config' ;
64+
65+ @Module ({
66+ imports: [MikroOrmModule .forRoot (config )],
67+ })
68+ export class AppModule {}
69+ ```
5970
6071Afterward, the ` EntityManager ` will be available to inject across entire project (without importing any module elsewhere).
6172
You can’t perform that action at this time.
0 commit comments